/* Interview Coach - Modern UI/UX */
/* Design: Developer-focused, clean, professional */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #0ea5e9;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #0f172a;
    --gray: #64748b;
    --light: #f8fafc;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius: 12px;
    --radius-sm: 8px;
}

* {
    box-sizing: border-box;
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f1f5f9;
    color: var(--dark);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    max-width: 100vw;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--dark);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

/* Buttons */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 0.9375rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

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

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

/* Cards */
.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all 0.3s;
    background: white;
}

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

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background: transparent;
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
}

/* Forms */
.form-control, .form-select {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    transition: all 0.2s;
    font-size: 1rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-label {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

/* Badges */
.badge {
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
}

.bg-success {
    background: linear-gradient(135deg, #22c55e, #16a34a) !important;
}

.bg-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
}

.bg-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
}

.bg-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
}

.bg-info {
    background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
}

/* Tables */
.table {
    border-radius: var(--radius);
    overflow: hidden;
}

.table thead th {
    background: var(--light);
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

.table-hover tbody tr:hover {
    background: rgba(99, 102, 241, 0.04);
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border-left: 4px solid #22c55e;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-left: 4px solid #ef4444;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border-left: 4px solid #f59e0b;
}

.alert-info {
    background: rgba(14, 165, 233, 0.1);
    color: #0284c7;
    border-left: 4px solid #0ea5e9;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, var(--dark), #0f172a);
    padding: 1rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: white !important;
}

.nav-link {
    color: rgba(255,255,255,0.7);
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

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

/* Sidebar - Fixed position on left */
.sidebar {
    background: linear-gradient(180deg, var(--dark), #0f172a) !important;
    height: 100vh !important;
    width: 280px !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    z-index: 100 !important;
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Main content - Pushed right of sidebar */
.main-content {
    margin-left: 280px !important;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    overflow-x: hidden;
}

/* Top bar */
.top-row {
    background: white;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

/* Code Editor */
.code-editor {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    tab-size: 4;
    resize: vertical;
    background-color: #1e1e1e;
    color: #d4d4d4;
    border: none;
    border-radius: var(--radius);
    padding: 1.5rem;
    width: 100%;
    min-height: 400px;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
}

.code-editor:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary);
}

/* Progress bars */
.progress {
    height: 10px;
    border-radius: 20px;
    background: var(--border);
    overflow: hidden;
}

.progress-bar {
    border-radius: 20px;
    transition: width 0.6s ease;
}

/* Tier display */
.tier-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
}

.tier-display {
    text-align: center;
    padding: 2rem;
}

/* WhatsApp button */
.btn-whatsapp {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s;
    border: none;
    font-size: 1rem;
}

.btn-whatsapp:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(37, 211, 102, 0.3);
    color: white;
}

/* Hero section */
.hero-section {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius);
    padding: 4rem 2rem;
    color: white;
    text-align: center;
    margin-bottom: 2rem;
}

.hero-section h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-section p {
    color: rgba(255,255,255,0.9);
    font-size: 1.125rem;
}

/* Feature cards */
.feature-card {
    text-align: center;
    padding: 2rem;
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Stats cards */
.stats-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow);
}

.stats-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Login page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
}

.login-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
}

/* Admin dashboard */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light);
}

::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: 4px;
}

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

/* Loading spinner */
.spinner-border {
    width: 1.5rem;
    height: 1.5rem;
    border-width: 0.15em;
}

/* Modal */
.modal-content {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

/* Utility classes */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-gray { color: var(--gray) !important; }

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.rounded-xl {
    border-radius: var(--radius);
}

.shadow-soft {
    box-shadow: var(--shadow);
}

.shadow-strong {
    box-shadow: var(--shadow-lg);
}

/* ============================================
   MOBILE RESPONSIVE - Phones (max-width: 767px)
   ============================================ */
@media (max-width: 767px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: none;
    }

    .sidebar.show {
        transform: translateX(0);
        box-shadow: 5px 0 15px rgba(0,0,0,0.3);
    }

    .main-content {
        margin-left: 0;
        max-width: 100vw;
    }

    .top-row {
        padding: 0.75rem 1rem;
    }

    .top-row h4 {
        font-size: 1rem;
    }

    .content {
        padding: 1rem !important;
    }

    .hero-section {
        padding: 2rem 1rem;
        border-radius: var(--radius-sm);
        margin-bottom: 1.5rem;
    }

    .hero-section h1 {
        font-size: 1.75rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    .hero-section .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .card {
        border-radius: var(--radius-sm);
    }

    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 1rem;
    }

    .card-footer {
        padding: 0.75rem 1rem;
    }

    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
        min-height: 48px;
    }

    .btn-sm {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        min-height: 40px;
    }

    .btn-lg {
        padding: 1rem 1.5rem;
        font-size: 1.125rem;
    }

    .form-control, .form-select {
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }

    .form-label {
        font-size: 0.875rem;
        margin-bottom: 0.375rem;
    }

    .table-responsive {
        font-size: 0.875rem;
        -webkit-overflow-scrolling: touch;
    }

    .table thead th,
    .table tbody td {
        padding: 0.75rem;
        white-space: nowrap;
    }

    .code-editor {
        font-size: 13px;
        min-height: 250px;
        padding: 1rem;
    }

    .feature-card {
        padding: 1.5rem;
    }

    .feature-icon {
        font-size: 2.5rem;
    }

    .stats-card {
        padding: 1rem;
    }

    .stats-card h3 {
        font-size: 1.5rem;
    }

    .alert {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }

    .badge {
        padding: 0.375rem 0.625rem;
        font-size: 0.6875rem;
    }

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

    .login-card {
        padding: 1.5rem;
        margin: 0 -1rem;
        border-radius: 0;
        box-shadow: none;
    }

    .problem-description {
        max-height: 300px;
    }

    .d-flex.gap-2 {
        flex-wrap: wrap;
    }

    .d-flex.gap-2 .btn {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 0;
    }

    .filter-section .row > div {
        margin-bottom: 0.75rem;
    }

    .question-card .card-title {
        font-size: 1rem;
    }

    .question-card .card-text {
        font-size: 0.875rem;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .evaluation-stats .col-md-4 {
        margin-bottom: 0.75rem;
    }

    .hamburger-btn {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 99;
    }

    .btn-whatsapp {
        width: 100%;
        justify-content: center;
        padding: 0.875rem 1.5rem;
    }

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

    .tier-display {
        padding: 1.5rem 1rem;
    }

    .progress-stats .col-6 {
        margin-bottom: 1rem;
    }
}

/* ============================================
   TABLET RESPONSIVE (768px - 1024px)
   ============================================ */
@media (min-width: 768px) and (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }

    .main-content {
        margin-left: 240px;
    }

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

    .hero-section {
        padding: 3rem 1.5rem;
    }

    .hero-section h1 {
        font-size: 2rem;
    }
}

/* ============================================
   DESKTOP (1025px+)
   ============================================ */
@media (min-width: 1025px) {
    .hamburger-btn {
        display: none;
    }
}
