/**
 * Main Stylesheet
 * NCE Practice Portal
 */

/* =============================================
   CSS VARIABLES
============================================= */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;

    --text-color: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;

    --bg-color: #f8fafc;
    --bg-white: #ffffff;
    --bg-light: #f1f5f9;

    --border-color: #e2e8f0;
    --border-radius: 8px;
    --border-radius-sm: 4px;
    --border-radius-lg: 12px;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Consolas, monospace;

    --header-height: 64px;
    --container-width: 1200px;
}

/* =============================================
   RESET & BASE
============================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-family);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.5rem 0;
    font-weight: 600;
    line-height: 1.25;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p {
    margin: 0 0 1rem 0;
}

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

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* =============================================
   LAYOUT
============================================= */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* =============================================
   HEADER
============================================= */
.site-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.logo {
    text-decoration: none;
    color: var(--text-color);
}

.logo h1 {
    font-size: 1.25rem;
    margin: 0;
}

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

.main-nav a {
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.2s;
}

.main-nav a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border-color);
}

.user-name {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* =============================================
   FOOTER
============================================= */
.site-footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-top: auto;
}

.site-footer p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.875rem;
    text-align: center;
}

/* =============================================
   BUTTONS
============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

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

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

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

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

.btn-secondary:hover {
    background: #475569;
}

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

.btn-success:hover {
    background: #16a34a;
}

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

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

.btn-outline {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-color);
}

.btn-outline:hover {
    background: var(--bg-light);
}

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

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

/* =============================================
   FORMS
============================================= */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.5;
    color: var(--text-color);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.form-error {
    color: var(--danger-color);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

/* =============================================
   ALERTS
============================================= */
.alert {
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
}

.alert-success {
    background: #dcfce7;
    border-color: #bbf7d0;
    color: #166534;
}

.alert-error,
.alert-danger {
    background: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

.alert-info {
    background: #e0f2fe;
    border-color: #bae6fd;
    color: #075985;
}

/* =============================================
   CARDS
============================================= */
.card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

.card-title {
    margin: 0;
    font-size: 1.125rem;
}

/* =============================================
   AUTH PAGES
============================================= */
.auth-container {
    max-width: 400px;
    margin: 2rem auto;
}

.auth-card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.auth-header {
    padding: 2rem;
    text-align: center;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.auth-header h2 {
    margin: 0;
}

.auth-body {
    padding: 2rem;
}

.auth-footer {
    padding: 1rem 2rem;
    text-align: center;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.875rem;
}

/* =============================================
   TABLES
============================================= */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.table tbody tr:hover {
    background: var(--bg-light);
}

/* =============================================
   BADGES
============================================= */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
}

.badge-primary {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* =============================================
   UTILITIES
============================================= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* =============================================
   RESPONSIVE
============================================= */
@media (max-width: 768px) {
    .main-nav {
        gap: 1rem;
    }

    .user-menu {
        display: none;
    }

    .container {
        padding: 0 0.75rem;
    }

    .auth-container {
        margin: 1rem;
        max-width: none;
    }
}
