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

:root {
    --bg-main: #f0f2f5;
    --white: #ffffff;
    --text-dark: #1a1d23;
    --text-body: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --border-light: #edf2f7;

    --accent-green: #10b981;
    --accent-green-dark: #059669;
    --accent-blue: #3b82f6;
    --accent-blue-dark: #2563eb;
    --accent-purple: #8b5cf6;
    --accent-red: #ef4444;
    --accent-orange: #f59e0b;
    --accent-teal: #14b8a6;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 40px -8px rgba(0,0,0,0.1);

    --radius: 10px;
    --radius-lg: 14px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-body);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Utility Classes */
.text-center { text-align: center; }

/* Layout */
.container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========== HEADER ========== */
.top-header {
    background: var(--white);
    border-bottom: 2px solid var(--border-light);
    padding: 0;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo-img {
    height: 52px;
    transition: transform 0.2s;
}

.logo-img:hover {
    transform: scale(1.05);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 15px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
}

.main-nav a:hover {
    color: var(--accent-blue);
    background: #eff6ff;
}

.main-nav a.active {
    color: var(--accent-blue);
    background: #eff6ff;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-right a {
    text-decoration: none;
    color: var(--accent-purple);
    font-weight: 600;
    font-size: 14px;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.2s;
}

.header-right a:hover {
    background: #f5f3ff;
}

/* ========== CARDS ========== */
.card {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
    font-weight: 700;
    font-size: 16px;
    color: var(--text-dark);
    background: linear-gradient(to right, #fafbfc, var(--white));
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
    transition: background 0.2s;
}

.card-header:hover {
    background: linear-gradient(to right, #f0f4f8, #fafbfc);
}

.card-header i {
    color: var(--accent-blue);
    font-size: 14px;
    transition: transform 0.3s;
}

.card-body {
    padding: 24px;
}

/* ========== FILTER GRID ========== */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    color: var(--text-body);
    outline: none;
    transition: all 0.25s;
    background: var(--white);
}

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

.form-control:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.form-control:disabled {
    background-color: #f7fafc;
    color: var(--text-muted);
    cursor: not-allowed;
    border-style: dashed;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%234a5568'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 36px;
}

/* ========== BUTTONS ========== */
.filter-actions {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: 2px solid transparent;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-outline-success {
    background: var(--white);
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.btn-outline-success:hover {
    background: #ecfdf5;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-green), var(--accent-green-dark));
    color: var(--white);
    border-color: var(--accent-green);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-kolonlar {
    background: linear-gradient(135deg, var(--accent-purple), #7c3aed);
    color: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.btn-kolonlar:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-tercih-listem {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-dark));
    color: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-tercih-listem:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-tercih-listem .badge {
    background: var(--accent-red);
    color: var(--white);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    margin-left: 4px;
}

/* ========== TABLE CONTROLS ========== */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 4px;
}

.view-toggles {
    display: flex;
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.btn-toggle {
    padding: 10px 22px;
    background: var(--white);
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-toggle:hover {
    background: #f7fafc;
}

.btn-toggle.active {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-dark));
    color: var(--white);
}

/* ========== TABLE ========== */
.table-card {
    padding: 0;
    position: relative;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

th {
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
    font-weight: 700;
    color: var(--text-dark);
    font-size: 13px;
    text-align: left;
    white-space: nowrap;
    padding: 16px 20px;
    border-bottom: 2px solid var(--border-color);
    border-top: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

th:hover {
    background: linear-gradient(to bottom, #edf2f7, #e2e8f0);
    color: var(--accent-blue);
}

td {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    font-size: 15px;
    color: var(--text-body);
}

tbody tr {
    transition: all 0.15s ease;
}

tbody tr:hover {
    background: linear-gradient(to right, #eff6ff, #fafbfc);
    box-shadow: inset 4px 0 0 var(--accent-blue);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ========== TABLE CELL STYLES ========== */
.btn-add {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-teal), #0d9488);
    color: var(--white);
    border: none;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0 auto;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.35);
}

.btn-add:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.5);
}

.program-code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-dark);
    background: #f7fafc;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    display: inline-block;
}

.university-name {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.4;
}

.uni-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-green);
    background: #ecfdf5;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #a7f3d0;
}

.program-faculty {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: 4px;
}

.program-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-dark);
    margin-bottom: 4px;
    line-height: 1.3;
}

.program-puan-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.03em;
}

.badge-say { background: #dbeafe; color: #1e40af; }
.badge-ea { background: #fef3c7; color: #92400e; }
.badge-soz { background: #fee2e2; color: #991b1b; }
.badge-dil { background: #e0e7ff; color: #3730a3; }
.badge-tyt { background: #d1fae5; color: #065f46; }

.program-duration {
    color: var(--accent-red);
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
}

.program-icons {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.program-icons i {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 12px;
    background: #f5f3ff;
    color: var(--accent-purple);
    transition: all 0.2s;
}

.program-icons i:hover {
    background: #ede9fe;
    transform: scale(1.1);
}

/* Kontenjan */
.kontenjan-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-dark);
}

/* Doluluk */
.chart-doluluk {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 12px;
}

.doluluk-full {
    border: 3px solid var(--accent-green);
    color: var(--accent-green);
    background: #ecfdf5;
}

.doluluk-empty {
    border: 3px solid #fbbf24;
    color: #d97706;
    background: #fffbeb;
}

/* Başarı Sırası */
.basari-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    white-space: nowrap;
}

.basari-empty {
    color: var(--text-muted);
    font-style: italic;
    font-weight: 500;
}

/* Puan */
.puan-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-blue-dark);
    white-space: nowrap;
}

.puan-empty {
    color: var(--text-muted);
    font-style: italic;
    font-weight: 500;
}

.info-icon {
    color: var(--accent-purple);
    margin-left: 6px;
    font-size: 13px;
    cursor: help;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.info-icon:hover {
    opacity: 1;
}

/* ========== LOADER ========== */
.loader-container {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========== EMPTY STATE ========== */
.empty-state {
    padding: 60px 20px;
    text-align: center;
}

.empty-state i {
    font-size: 48px;
    color: #cbd5e0;
    margin-bottom: 16px;
    display: block;
}

.empty-state p {
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
    .filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
    .header-container {
        flex-direction: column;
        height: auto;
        padding: 12px 0;
        gap: 12px;
    }
    .table-controls {
        flex-direction: column;
        gap: 12px;
    }
    td, th {
        padding: 12px 14px;
    }
}
