/* Global Variables */
:root {
    --primary-color: #000;
    --bg-color: #fafafa;
    --border-color: #e5e5e5;
    --text-color: #333;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    border-bottom: 1px solid transparent;
}

.tabs button {
    padding: 10px 0;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    transition: all 0.2s;
    position: relative;
    font-weight: 500;
}

.tabs button.active {
    color: #000;
    font-weight: 600;
}

.tabs button.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #000;
}

.tabs button:hover {
    color: #000;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 60px;
    text-align: center;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-area:hover {
    border-color: #999;
    background: #fdfdfd;
}

.upload-content svg {
    color: #999;
    margin-bottom: 16px;
}

.support-text {
    display: block;
    margin-top: 8px;
    font-size: 0.9rem;
    color: #999;
}

/* PDF Workspace */
.pdf-workspace {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pdf-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-pill {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 500;
    border: none;
    transition: all 0.2s;
}

.btn-pill:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-black {
    background: #000;
    color: #fff;
}

.btn-black:hover {
    background: #333;
}

.btn-white {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
}

.btn-white:hover {
    background: #f5f5f5;
}

.btn-red {
    background: #ff4d4f;
    color: #fff;
}

.btn-red:hover {
    background: #ff7875;
}

.pdf-pagination {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f0f0f0;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-icon:hover:not(:disabled) {
    background: #e0e0e0;
}

.btn-icon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-indicator {
    font-size: 1rem;
    color: #333;
    font-weight: 500;
}

.pdf-preview-container {
    width: 100%;
    display: flex;
    justify-content: center;
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    min-height: 500px;
    position: relative;
}

.canvas-wrapper {
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #333;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.download-section {
    margin-top: 20px;
}

/* Image/Video File List (Legacy) */
.file-list {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 20px;
}

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.btn {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.file-item {
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
}

.file-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.preview-area {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.preview-box {
    flex: 1;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

.preview-box img, .preview-box video {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
}

.btn-download {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 16px;
    background: #333;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
}
