@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap');

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #375BD2;
    --primary-dark: #1a3fa0;
    --dark-navy: #1a1a2e;
    --medium-navy: #16213e;
    --accent-teal: #19857b;
    --light-blue: #64b5f6;
    --background-dark: #0f0f1e;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(55, 91, 210, 0.3);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --success: #4caf50;
    --warning: #ff9800;
    --error: #f44336;
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(135deg, var(--dark-navy) 0%, var(--medium-navy) 50%, #0f3460 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ===== LAYOUT ===== */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding-top: 80px;
    padding-bottom: 40px;
}

/* ===== HEADER ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.header-logo-icon {
    font-size: 2rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.header-brand {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.header-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.header-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-link:hover {
    color: var(--primary-blue);
}

.header-btn {
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(55, 91, 210, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(55, 91, 210, 0.4);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-left: 1.5rem;
    border-left: 1px solid var(--card-border);
}

.user-name {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logout-btn {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

.logout-btn:hover {
    background: linear-gradient(135deg, #e53935, #c62828);
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.4);
}

/* ===== FOOTER ===== */
.footer {
    background: rgba(15, 15, 30, 0.95);
    border-top: 1px solid var(--card-border);
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-link:hover {
    color: var(--primary-blue);
}

.footer-social {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(55, 91, 210, 0.4);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-copy {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ===== CARDS ===== */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-blue);
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* Stats Section */
.stats-section {
    padding: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 18px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid var(--card-border);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-md);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-blue);
    text-shadow: 0 2px 4px rgba(55, 91, 210, 0.3);
}

/* Upload Tabs */
.upload-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    cursor: pointer;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.tab-content {
    padding-top: 20px;
}

.tab-content.hidden {
    display: none;
}

/* File Input */
.file-input-wrapper {
    margin-bottom: 20px;
}

.file-input-wrapper input[type="file"] {
    display: none;
}

.file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border: 2px dashed var(--primary-blue);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(55, 91, 210, 0.1);
    backdrop-filter: blur(5px);
}

.file-label:hover {
    border-color: var(--light-blue);
    background: rgba(55, 91, 210, 0.2);
    transform: translateY(-2px);
}

.file-icon {
    font-size: 2.5rem;
    margin-right: 10px;
}

.file-text {
    font-size: 1.1rem;
    color: var(--light-blue);
    font-weight: 500;
}

.selected-file {
    margin-top: 10px;
    padding: 12px;
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 8px;
    font-size: 0.95rem;
    color: #81c784;
    font-weight: 500;
    display: none;
}

.selected-file.show {
    display: block;
}

.info-note {
    background: rgba(55, 91, 210, 0.15);
    border: 1px solid rgba(55, 91, 210, 0.3);
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    backdrop-filter: blur(5px);
}

.info-note strong {
    color: var(--light-blue);
    font-weight: 600;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    font-size: 0.95rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-blue);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Progress */
.progress-container {
    margin-top: 20px;
}

.progress-container.hidden {
    display: none;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    width: 0%;
    transition: width 0.3s;
    animation: progress-animation 1.5s infinite;
    box-shadow: 0 0 10px rgba(55, 91, 210, 0.5);
}

@keyframes progress-animation {
    0% { width: 0%; }
    50% { width: 100%; }
    100% { width: 0%; }
}

.progress-text {
    text-align: center;
    color: #667eea;
    font-weight: 600;
}

/* Result */
.result-container {
    margin-top: 20px;
    padding: 20px;
    border-radius: 8px;
}

.result-container.hidden {
    display: none;
}

.result-container.success {
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.4);
    color: var(--text-primary);
    backdrop-filter: blur(5px);
}

.result-container.success strong,
.result-container.success h4 {
    color: #81c784;
}

.result-container.error {
    background: rgba(244, 67, 54, 0.15);
    border: 1px solid rgba(244, 67, 54, 0.4);
    color: var(--text-primary);
    backdrop-filter: blur(5px);
}

.result-container.error strong,
.result-container.error h4 {
    color: #ff6b6b;
}

.result-item {
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.result-item h4 {
    margin-bottom: 10px;
    color: var(--light-blue);
    font-weight: 600;
}

.result-item p {
    margin: 5px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.result-item p strong {
    color: var(--text-primary);
}

.result-item a {
    color: var(--primary-blue);
    text-decoration: none;
    word-break: break-all;
    transition: color 0.3s ease;
}

.result-item a:hover {
    color: var(--light-blue);
    text-decoration: underline;
}

.cid-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(55, 91, 210, 0.2);
    padding: 12px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--light-blue);
    word-break: break-all;
    margin: 10px 0;
    line-height: 1.6;
}

/* Controls Section */
.controls-section {
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.filter-controls {
    display: flex;
    gap: 10px;
}

.control-select {
    padding: 12px 15px;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    background: var(--card-bg);
    color: var(--text-primary);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.control-select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px rgba(55, 91, 210, 0.2);
}

.control-select option {
    background: var(--medium-navy);
    color: var(--text-primary);
}

/* Bulk Actions Bar */
.bulk-actions-bar {
    background: rgba(55, 91, 210, 0.2);
    border: 2px solid var(--primary-blue);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.bulk-actions-bar.hidden {
    display: none;
}

.bulk-actions-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bulk-actions-left input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.bulk-actions-left label {
    font-weight: 600;
    cursor: pointer;
}

#selected-count {
    color: #667eea;
    font-weight: 600;
}

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

/* Files Section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 500;
}

.loading.hidden {
    display: none;
}

.error {
    padding: 16px;
    background: rgba(244, 67, 54, 0.15);
    border: 1px solid rgba(244, 67, 54, 0.4);
    color: #ff6b6b;
    border-radius: 8px;
    margin-bottom: 20px;
    backdrop-filter: blur(5px);
    font-weight: 500;
}

.error.hidden {
    display: none;
}

.no-files {
    text-align: center;
    padding: 60px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.no-files.hidden {
    display: none;
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.file-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: var(--shadow-md);
}

.file-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-blue);
}

.file-card.selected {
    border-color: var(--primary-blue);
    background: rgba(55, 91, 210, 0.15);
    box-shadow: 0 0 0 2px rgba(55, 91, 210, 0.3);
}

.file-card-checkbox {
    position: absolute;
    top: 15px;
    right: 15px;
}

.file-card-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.file-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--text-primary);
    word-break: break-word;
    padding-right: 30px;
}

.file-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
}

.file-info strong {
    color: var(--text-primary);
    font-weight: 500;
}

.file-cid {
    margin-top: 10px;
    margin-bottom: 5px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(55, 91, 210, 0.2);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--light-blue);
    word-break: break-all;
    line-height: 1.6;
}

.file-links {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.file-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark));
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(55, 91, 210, 0.3);
}

.file-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(55, 91, 210, 0.4);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-blue));
}

.file-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--card-border);
}

.no-cid {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.9rem;
    padding: 10px;
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: 6px;
    margin-top: 10px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--medium-navy);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.modal-content h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-weight: 600;
}

.modal-content p {
    margin-bottom: 25px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .card {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .files-grid {
        grid-template-columns: 1fr;
    }

    .controls-section {
        flex-direction: column;
    }

    .filter-controls {
        flex-direction: column;
        width: 100%;
    }

    .control-select {
        width: 100%;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .section-header .btn {
        width: 100%;
    }

    .bulk-actions-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .bulk-actions-right {
        width: 100%;
    }

    .bulk-actions-right .btn {
        flex: 1;
    }
}
