:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --accent-primary: #0d6efd;
    --accent-hover: #0b5ed7;
    --success: #198754;
    --error: #dc3545;
    --border: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3d3d3d;
    --text-primary: #e9ecef;
    --text-secondary: #adb5bd;
    --accent-primary: #4dabf7;
    --accent-hover: #339af0;
    --success: #51cf66;
    --error: #ff6b6b;
    --border: #495057;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 8px var(--shadow);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px var(--shadow-hover);
}

.theme-icon {
    width: 24px;
    height: 24px;
    color: var(--text-primary);
}

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

.header {
    text-align: center;
    padding: 40px 0;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    color: var(--accent-primary);
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.header-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.header-actions a {
    text-decoration: none;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.upload-section {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 16px var(--shadow);
}

.dropzone {
    border: 3px dashed var(--border);
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.dropzone:hover,
.dropzone.drag-over {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
    transform: scale(1.01);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.dropzone-icon {
    width: 80px;
    height: 80px;
    color: var(--accent-primary);
    opacity: 0.8;
}

.dropzone h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.dropzone p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-hover);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border);
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
}

.btn-cancel {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: var(--bg-secondary);
    color: var(--error);
}

.btn-copy {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-copy:hover {
    background: var(--accent-hover);
}

.file-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 10px;
}

.upload-progress {
    padding: 30px;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-top: 20px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.progress-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-icon {
    width: 40px;
    height: 40px;
    color: var(--accent-primary);
}

.progress-text {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 600;
    font-size: 1.1rem;
    word-break: break-all;
}

.file-size {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.progress-bar-container {
    background: var(--bg-tertiary);
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-hover));
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 6px;
}

.progress-percent {
    text-align: right;
    font-weight: 600;
    color: var(--accent-primary);
    font-size: 1.1rem;
}

.upload-result,
.upload-error {
    padding: 30px;
    border-radius: 12px;
    margin-top: 20px;
    text-align: center;
}

.result-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.result-icon {
    width: 64px;
    height: 64px;
    color: var(--success);
}

.result-success h3 {
    font-size: 1.8rem;
    color: var(--success);
}

.result-link {
    width: 100%;
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.result-link input {
    flex: 1;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.result-details {
    width: 100%;
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    text-align: left;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.detail-value {
    color: var(--text-primary);
    word-break: break-all;
}

.error-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.error-icon {
    width: 64px;
    height: 64px;
    color: var(--error);
}

.error-content h3 {
    font-size: 1.8rem;
    color: var(--error);
}

.error-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.history-section {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 16px var(--shadow);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.history-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
}

.btn-clear {
    background: transparent;
    color: var(--error);
    border: 2px solid var(--error);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-clear:hover {
    background: var(--error);
    color: white;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    gap: 15px;
}

.history-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(5px);
}

.history-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 0;
}

.history-info .file-icon {
    flex-shrink: 0;
}

.history-details {
    flex: 1;
    min-width: 0;
}

.history-name {
    font-weight: 600;
    margin-bottom: 5px;
    word-break: break-all;
}

.history-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.history-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

.footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-secondary);
}

.footer a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--accent-hover);
}

.notification {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: 10px;
    box-shadow: 0 4px 16px var(--shadow-hover);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: bottom 0.4s ease;
    z-index: 2000;
    border: 2px solid var(--border);
    min-width: 300px;
}

.notification.show {
    bottom: 30px;
}

.notification-icon {
    width: 24px;
    height: 24px;
}

.notification.success {
    border-color: var(--success);
}

.notification.success .notification-icon {
    color: var(--success);
}

.notification.error {
    border-color: var(--error);
}

.notification.error .notification-icon {
    color: var(--error);
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header {
        padding: 30px 0;
    }

    .header h1 {
        font-size: 2rem;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
    }

    .subtitle {
        font-size: 1rem;
    }

    .upload-section {
        padding: 25px;
    }

    .dropzone {
        padding: 40px 20px;
    }

    .dropzone-icon {
        width: 60px;
        height: 60px;
    }

    .dropzone h2 {
        font-size: 1.2rem;
    }

    .btn-primary {
        padding: 12px 24px;
        font-size: 0.95rem;
    }

    .result-link {
        flex-direction: column;
    }

    .history-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .history-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .history-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .theme-toggle {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.6rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .upload-section {
        padding: 20px;
    }

    .dropzone {
        padding: 30px 15px;
    }

    .dropzone h2 {
        font-size: 1.1rem;
    }

    .notification {
        min-width: 250px;
        left: 15px;
        right: 15px;
        transform: none;
    }

    .notification.show {
        bottom: 15px;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }

    .header h1 {
        font-size: 3rem;
    }

    .dropzone {
        padding: 80px 50px;
    }
}
