/* ============================================
   Secure File Vault Pro - Styles
   ============================================ */

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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1e293b;
    --dark-light: #334155;
    --gray: #64748b;
    --light: #f1f5f9;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark);
}

/* ============================================
   Pages
   ============================================ */

.page {
    display: none;
}

.page.active {
    display: block;
}

/* ============================================
   Auth Page
   ============================================ */

.auth-container {
    max-width: 450px;
    margin: 50px auto;
    padding: 20px;
}

.logo {
    text-align: center;
    color: var(--white);
    margin-bottom: 30px;
}

.logo h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.logo p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.auth-form {
    background: var(--white);
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.auth-form h2 {
    margin-bottom: 25px;
    color: var(--dark);
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--light);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--gray);
    font-size: 0.85rem;
}

.switch-form {
    text-align: center;
    margin-top: 20px;
    color: var(--gray);
}

.switch-form a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.switch-form a:hover {
    text-decoration: underline;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--gray);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--dark-light);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

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

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

/* ============================================
   Navbar
   ============================================ */

.navbar {
    background: var(--white);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.nav-brand h2 {
    color: var(--primary);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-menu span {
    font-weight: 600;
    color: var(--dark);
}

/* ============================================
   Container
   ============================================ */

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

/* ============================================
   Stats Grid
   ============================================ */

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

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 3rem;
}

.stat-info h3 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-info p {
    color: var(--gray);
    font-size: 0.95rem;
}

/* ============================================
   Upload Section
   ============================================ */

.upload-section {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.upload-section h2 {
    margin-bottom: 20px;
    color: var(--dark);
}

.upload-area {
    border: 3px dashed var(--primary);
    border-radius: 12px;
    padding: 50px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--light);
}

.upload-area:hover {
    background: #e0e7ff;
    border-color: var(--primary-dark);
}

.upload-area.drag-over {
    background: #e0e7ff;
    border-color: var(--success);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.upload-area p {
    color: var(--gray);
    margin-bottom: 15px;
}

.encrypt-form {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid var(--light);
}

.file-preview {
    background: var(--light);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-preview span:first-child {
    font-weight: 600;
    color: var(--dark);
}

.file-preview span:last-child {
    color: var(--gray);
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.form-actions button {
    flex: 1;
}

/* ============================================
   Files Section
   ============================================ */

.files-section {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.files-section h2 {
    margin-bottom: 20px;
    color: var(--dark);
}

.search-bar {
    margin-bottom: 20px;
}

.search-bar input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--light);
    border-radius: 8px;
    font-size: 1rem;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
}

.files-list {
    display: grid;
    gap: 15px;
}

.file-item {
    background: var(--light);
    padding: 20px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.file-item:hover {
    background: #e2e8f0;
    transform: translateX(5px);
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.file-meta {
    display: flex;
    gap: 15px;
    color: var(--gray);
    font-size: 0.9rem;
}

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

.file-actions button {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

.empty-state .icon {
    font-size: 5rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 10px;
}

/* ============================================
   Modal
   ============================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--white);
    padding: 40px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: slideUp 0.3s ease;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--gray);
    transition: color 0.3s;
}

.close:hover {
    color: var(--danger);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: var(--dark);
}

.modal-content p {
    margin-bottom: 20px;
    color: var(--gray);
}

.share-link-box {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding: 15px;
    background: var(--light);
    border-radius: 8px;
}

.share-link-box input {
    flex: 1;
    padding: 10px;
    border: none;
    background: var(--white);
    border-radius: 5px;
}

/* ============================================
   Animations
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   Alerts
   ============================================ */

.alert {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

.alert-success {
    background: var(--success);
    color: var(--white);
}

.alert-error {
    background: var(--danger);
    color: var(--white);
}

.alert-info {
    background: var(--primary);
    color: var(--white);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 15px;
    }

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

    .file-item {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .file-actions {
        width: 100%;
    }

    .file-actions button {
        flex: 1;
    }

    .form-actions {
        flex-direction: column;
    }

    .upload-area {
        padding: 30px 20px;
    }
}

/* ============================================
   Loading Spinner
   ============================================ */

.spinner {
    border: 3px solid var(--light);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

.loading-overlay {
    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: 3000;
}

.loading-content {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
}

.loading-content p {
    margin-top: 15px;
    color: var(--dark);
    font-weight: 600;
}


/* ============================================
   Navigation Links
   ============================================ */

.nav-links {
    display: flex;
    gap: 5px;
    align-items: center;
}

.nav-link {
    padding: 8px 15px;
    color: var(--dark);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-link:hover {
    background: var(--light);
}

.nav-link.active {
    background: var(--primary);
    color: var(--white);
}

.badge {
    background: var(--danger);
    color: var(--white);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-left: 5px;
}

/* ============================================
   Page Header
   ============================================ */

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

.page-header h1 {
    color: var(--white);
    font-size: 2rem;
}

/* ============================================
   Settings Page
   ============================================ */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
}

.settings-card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.settings-card h3 {
    margin-bottom: 25px;
    color: var(--primary);
    border-bottom: 2px solid var(--light);
    padding-bottom: 10px;
}

.danger-zone {
    border: 2px solid var(--danger);
}

.danger-zone h3 {
    color: var(--danger);
    border-bottom-color: #fee2e2;
}

.danger-zone p {
    margin-bottom: 20px;
    color: var(--gray);
}

/* ============================================
   Analytics Page
   ============================================ */

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

.analytics-card {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.analytics-card h3 {
    margin-bottom: 20px;
    color: var(--dark);
}

#sizeDistribution, #topShared {
    padding: 10px 0;
}

.distribution-item, .shared-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 10px;
    background: var(--light);
    border-radius: 8px;
}

.distribution-bar {
    height: 8px;
    background: var(--primary);
    border-radius: 4px;
    margin-top: 5px;
}

/* ============================================
   Notifications Page
   ============================================ */

.notifications-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid var(--light);
    background: var(--white);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.filter-btn:hover {
    border-color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

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

.notification-item {
    background: var(--white);
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 15px;
    align-items: start;
    transition: all 0.3s;
}

.notification-item:hover {
    transform: translateX(5px);
}

.notification-item.unread {
    border-left: 4px solid var(--primary);
    background: #f0f4ff;
}

.notification-icon {
    font-size: 2rem;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 5px;
}

.notification-message {
    color: var(--gray);
    margin-bottom: 5px;
}

.notification-time {
    font-size: 0.85rem;
    color: var(--gray);
}

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

/* ============================================
   Audit Logs Page
   ============================================ */

.audit-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.audit-filters input,
.audit-filters select {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--light);
    border-radius: 8px;
    background: var(--white);
}

.audit-logs-table {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.audit-log-item {
    display: grid;
    grid-template-columns: 150px 100px 1fr 150px 150px;
    gap: 15px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--light);
    align-items: center;
}

.audit-log-item:hover {
    background: var(--light);
}

.audit-log-header {
    font-weight: 600;
    background: var(--primary);
    color: var(--white);
}

.audit-time {
    color: var(--gray);
    font-size: 0.9rem;
}

.audit-action {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
}

.audit-action.login { background: #e0f2fe; color: #0369a1; }
.audit-action.logout { background: #fee; color: #dc2626; }
.audit-action.encrypt { background: #dcfce7; color: #16a34a; }
.audit-action.decrypt { background: #fef3c7; color: #d97706; }
.audit-action.share { background: #e0e7ff; color: #4f46e5; }
.audit-action.delete { background: #fee; color: #dc2626; }

.audit-details {
    color: var(--dark);
}

.audit-ip {
    color: var(--gray);
    font-family: monospace;
    font-size: 0.9rem;
}

/* ============================================
   File Requests Page
   ============================================ */

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

.request-card {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.request-card:hover {
    transform: translateY(-5px);
}

.request-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.request-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark);
}

.request-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.request-status.active {
    background: #dcfce7;
    color: #16a34a;
}

.request-status.expired {
    background: #fee;
    color: #dc2626;
}

.request-info {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding: 15px;
    background: var(--light);
    border-radius: 8px;
}

.request-info-item {
    text-align: center;
}

.request-info-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary);
}

.request-info-label {
    font-size: 0.85rem;
    color: var(--gray);
}

.request-link {
    background: var(--light);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    word-break: break-all;
    font-size: 0.9rem;
    color: var(--gray);
}

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

.request-actions button {
    flex: 1;
    padding: 8px;
    font-size: 0.9rem;
}

/* ============================================
   Empty States
   ============================================ */

.empty-teams, .empty-notifications, .empty-logs, .empty-requests {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: 12px;
}

.empty-teams .icon,
.empty-notifications .icon,
.empty-logs .icon,
.empty-requests .icon {
    font-size: 5rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* ============================================
   Responsive - Additional Pages
   ============================================ */

@media (max-width: 1024px) {
    .nav-links {
        display: none;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .audit-log-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .teams-grid,
    .requests-grid {
        grid-template-columns: 1fr;
    }
    
    .audit-filters {
        flex-direction: column;
    }
    
    .notifications-filter {
        flex-wrap: wrap;
    }
    
    .team-stats {
        flex-direction: column;
        gap: 10px;
    }
}
