/* 
 * Yoklama Sistemi - Ultra Premium UI (Final Version)
 * Modern, Minimalist, Native-Feel, Robust Layout
 */

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

:root {
    /* Premium Palette - Indigo & Slate */
    --primary: #4f46e5;
    /* Indigo 600 */
    --primary-hover: #4338ca;
    /* Indigo 700 */
    --primary-soft: #e0e7ff;
    /* Indigo 100 */

    --surface: #ffffff;
    --background: #f8fafc;
    /* Slate 50 */
    --text-main: #0f172a;
    /* Slate 900 */
    --text-muted: #64748b;
    /* Slate 500 */
    --border: #e2e8f0;
    /* Slate 200 */

    --success: #10b981;
    /* Emerald 500 */
    --success-bg: #d1fae5;
    /* Emerald 100 */
    --danger: #ef4444;
    /* Red 500 */
    --danger-bg: #fee2e2;
    /* Red 100 */
    --warning: #f59e0b;
    /* Amber 500 */
    --warning-bg: #fef3c7;
    /* Amber 100 */

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

    --font-main: 'Inter', sans-serif;
    --transition: all 0.2s ease;
}

/* ===== RESET & LAYOUT ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    height: 100%;
}

body {
    font-family: var(--font-main);
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Padding for mobile nav safe area is handled in media query */
}

/* Push footer to bottom */
main.container {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ===== UTILITIES ===== */
a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.w-full {
    width: 100%;
}

.text-center {
    text-align: center;
}

/* Spacing */
.mt-1 {
    margin-top: 0.25rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

/* Flex Utilities */
.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.align-start {
    align-items: flex-start;
}

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

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

/* Visibility */
.mobile-only {
    display: none !important;
}

.desktop-only {
    display: block !important;
}

/* Text Colors */
.text-primary {
    color: var(--primary);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

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

/* ===== NAVIGATION ===== */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand a {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-links a {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 500;
    color: var(--text-muted);
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--primary-soft);
    color: var(--primary);
}

/* ===== FOOTER ===== */
footer {
    background: white;
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: auto;
    /* Safety net styling */
}

/* ===== COMPONENTS: CARDS ===== */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

/* Specialized Card for Courses */
.course-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.5rem;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.course-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-soft);
}

.active-session {
    border: 2px solid var(--success) !important;
    background: linear-gradient(to bottom right, #ffffff, #f0fdf4);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    gap: 0.5rem;
    font-size: 0.95rem;
}

.btn:active {
    transform: scale(0.98);
}

.btn-block {
    width: 100%;
}

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

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

.btn-secondary {
    background: white;
    border: 1px solid var(--border);
    color: var(--text-main);
}

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

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

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

/* ===== FORMS & AUTH ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0e7ff 100%);
    padding: 1rem;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-card {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.auth-header h1 {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-row {
    display: flex;
    gap: 1rem;
}

/* ===== BADGES ===== */
.badge {
    padding: 0.35em 0.8em;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-success {
    background: var(--success-bg);
    color: #065f46;
}

.badge-warning {
    background: var(--warning-bg);
    color: #92400e;
}

.badge-danger {
    background: var(--danger-bg);
    color: #991b1b;
}

.badge-info {
    background: var(--primary-soft);
    color: var(--primary);
}

/* ===== GRIDS & TABLES ===== */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

.photo-placeholder {
    aspect-ratio: 1;
    background: var(--background);
    border: 2px dashed var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

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

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--background);
}

/* ===== MODAL ===== */
.success-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    z-index: 999;
    justify-content: center;
    align-items: center;
}

.success-card-modal {
    background: white;
    padding: 2rem;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    border: 1px solid var(--primary-soft);
    animation: popIn 0.4s ease;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    body {
        padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }

    /* Space for bottom nav */

    .navbar {
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        right: 0;
        border-top: 1px solid var(--border);
        border-bottom: none;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
        background: rgba(255, 255, 255, 0.98);
        padding: 0;
        height: auto;
        min-height: 60px;
        padding-bottom: env(safe-area-inset-bottom);
        z-index: 1000;
    }

    .nav-container {
        padding: 0;
        width: 100%;
        height: 100%;
    }

    .nav-brand {
        display: none;
    }

    .nav-links {
        width: 100%;
        height: 60px;
        justify-content: space-between;
        gap: 0;
        margin: 0;
        padding: 0;
        display: flex;
    }

    .nav-links a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        font-size: 11px;
        padding: 4px 0;
        border-radius: 0;
        color: var(--text-muted);
        text-decoration: none;
        white-space: nowrap;
        height: 100%;
    }

    .nav-links a i {
        font-size: 1.4rem;
        margin-bottom: 2px;
        display: block;
    }

    .nav-links a.active {
        color: var(--primary);
        background: transparent;
        border-top: 2px solid var(--primary);
    }

    .btn-logout span {
        display: none;
    }

    .mobile-only {
        display: block !important;
    }

    .desktop-only {
        display: none !important;
    }

    .form-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Responsive Tables */
    .table thead {
        display: none;
    }

    .table,
    .table tbody,
    .table tr,
    .table td {
        display: block;
        width: 100%;
    }

    .table tr {
        background: white;
        margin-bottom: 1rem;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 1rem;
    }

    .table td {
        display: flex;
        justify-content: space-between;
        text-align: right;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--background);
    }

    .table td:last-child {
        border: none;
    }

    .table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
    }

    footer {
        padding: 1rem 0;
        margin-bottom: -1px; /* Sınır çizgisini gizlemek için */
        background: var(--background); /* Body ile aynı renk */
        border-top: 1px solid var(--border);
    }
}