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

:root {
    --bg-color: #f8fafc;
    --surface-color: rgba(255, 255, 255, 0.7);
    --surface-border: rgba(15, 23, 42, 0.08);
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #db2777;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --success: #059669;
    --danger: #dc2626;
    --input-bg: rgba(15, 23, 42, 0.04);
    --modal-bg: rgba(15, 23, 42, 0.4);
    --shadow: 0 8px 32px rgba(15, 23, 42, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    background-image: radial-gradient(circle at top right, rgba(99, 102, 241, 0.08), transparent 40%),
                      radial-gradient(circle at bottom left, rgba(236, 72, 153, 0.08), transparent 40%);
}

/* Glassmorphism utilities */
.glass {
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

/* Sidebar */
.sidebar {
    width: 280px;
    height: 100vh;
    padding: 2rem;
    position: fixed;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 10;
}

.brand {
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand span {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    padding: 1rem;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-item:hover, .nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

/* Main Content */
.main-content {
    margin-left: 280px;
    padding: 2rem;
    width: calc(100% - 280px);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.section {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.section.active {
    display: block;
}

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

h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    font-weight: 600;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 1rem;
    background: var(--input-bg);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: rgba(99, 102, 241, 0.1);
}

/* Cards & Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    padding: 1.5rem;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(99, 102, 241, 0.5);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Camera UI */
.camera-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.video-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 3/4;
    margin: 0 auto;
    border: 2px solid var(--surface-border);
}

.camera-guideline {
    position: absolute;
    top: 5%;
    left: 5%;
    width: 90%;
    height: 90%;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    z-index: 5;
}

.video-wrapper.crop-portrait .camera-guideline {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.video-wrapper.crop-square .camera-guideline {
    border-color: rgba(236, 72, 153, 0.6);
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.2);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: auto;
    aspect-ratio: 1 / 1;
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.photo-slot {
    padding: 1.5rem 1rem;
    text-align: center;
    border: 2px dashed var(--surface-border);
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    min-height: 260px;
}

.photo-slot.has-photo {
    border-style: solid;
    border-color: var(--success);
}

.photo-preview {
    width: 100%;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 1rem;
    display: none;
}

.photo-slot[data-type*="Practical"] .photo-preview {
    aspect-ratio: 1 / 1;
}

.photo-slot[data-type*="Subjective"] .photo-preview,
.photo-slot[data-type*="Objective"] .photo-preview {
    aspect-ratio: 3 / 4;
}

.photo-slot.has-photo .photo-preview {
    display: block;
}

.photo-slot.has-photo .placeholder {
    display: none;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.student-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.back-btn {
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.back-btn:hover {
    color: var(--text-main);
}

.mobile-header {
    display: none;
}

/* Mobile-First Responsive Styles */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        flex-direction: row;
        justify-content: space-around;
        padding: 0.5rem;
        border-radius: 16px 16px 0 0;
        border-width: 1px 0 0 0;
        gap: 0;
        box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.3);
    }
    
    .brand {
        display: none;
    }
    
    .nav-menu {
        flex-direction: row;
        flex: 1;
        justify-content: space-around;
        gap: 0;
    }
    
    .nav-item {
        padding: 0.5rem;
        flex-direction: column;
        gap: 0.25rem;
        font-size: 0.75rem;
        align-items: center;
        flex: 1;
        text-align: center;
        border-radius: 8px;
    }
    
    .nav-item i {
        font-size: 1.2rem;
    }

    .sidebar-footer {
        display: none !important;
    }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        border-radius: 12px;
        margin-bottom: 1.5rem;
        border: 1px solid var(--surface-border);
        background: var(--surface-color);
        box-shadow: var(--shadow);
    }
    
    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-weight: 700;
        font-size: 1.1rem;
        color: var(--primary-color);
    }

    .mobile-brand i {
        font-size: 1.2rem;
    }

    .mobile-user-status {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .mobile-user-info {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        font-size: 0.8rem;
        color: var(--text-main);
        background: rgba(15, 23, 42, 0.03);
        padding: 0.35rem 0.6rem;
        border-radius: 20px;
        border: 1px solid var(--surface-border);
    }

    .mobile-user-info i {
        color: var(--success);
    }

    .mobile-logout-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        color: var(--danger);
        background: rgba(220, 38, 38, 0.08);
        border: 1px solid rgba(220, 38, 38, 0.15);
        transition: all 0.3s ease;
        text-decoration: none;
    }

    .mobile-logout-btn:active {
        background: rgba(220, 38, 38, 0.15);
        transform: scale(0.95);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem 1rem 5.5rem 1rem;
        min-height: calc(100vh - 60px);
    }
    
    h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .photo-slots {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .video-wrapper {
        position: sticky;
        top: 10px;
        z-index: 100;
        aspect-ratio: 3 / 4;
        max-width: 320px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
        margin-bottom: 1.5rem;
    }
    
    .student-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        text-align: center;
    }
    
    #download-btn {
        width: 100%;
    }
}

/* Card header action layout */
.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    width: 100%;
}

.card-actions {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

/* Icon Buttons */
.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.btn-icon.delete-btn-icon:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.btn-icon.edit-btn-icon:hover {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-color);
}

/* Danger Button */
.btn-danger {
    background: linear-gradient(135deg, var(--danger), #ff6b6b);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--modal-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-backdrop.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-backdrop.active .modal-content {
    transform: translateY(0);
}

.modal-content.confirm-dialog {
    max-width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}

/* Inline Edit styles for Trades */
.inline-edit-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--primary-color);
    color: var(--text-main);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 1.25rem;
    font-weight: 600;
    font-family: inherit;
}
.inline-edit-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

/* Sidebar footer and user status */
.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-top: 1px solid var(--surface-border);
    padding-top: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-main);
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.user-info i {
    color: var(--success);
    font-size: 1.1rem;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: var(--danger) !important;
}

.btn-icon.download-student-btn:hover {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
}

.app-footer {
    text-align: center;
    padding: 2.5rem 0 1rem 0;
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid var(--surface-border);
    width: 100%;
}

.app-footer p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.app-footer strong {
    color: var(--primary-color);
    font-weight: 600;
}

