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

:root {
    --primary-color: #005f73;
    --secondary-color: #0a9396;
    --background-color: #f0f8ff;
    --card-background: #ffffff;
    --font-color: #333333;
    --light-gray: #e9ecef;
    --success-color: #2a9d8f;
    --warning-color: #e9c46a;
    --danger-color: #e76f51;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--font-color);
    line-height: 1.6;
    margin: 0;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

/* HEADER */
.main-header {
    background: var(--card-background);
    padding: 15px 30px;
    margin-bottom: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.main-header .logo {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--primary-color);
}
.main-header .user-info a {
    text-decoration: none;
    background: var(--danger-color);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: 600;
    transition: background 0.3s ease;
}
.main-header .user-info a:hover {
    background: #c25035;
}

/* CARD TASARIMI */
.card {
    background: var(--card-background);
    padding: 25px;
    margin-bottom: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-left: 5px solid var(--primary-color);
}
.card-header h2 {
    margin-top: 0;
    color: var(--primary-color);
}
.card-header h3 {
    margin-top: 0;
    color: var(--secondary-color);
}

/* DURUM ETİKETLERİ */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
}
.status-badge svg { margin-right: 6px; }
.status-onaylandi { background-color: #e0f2f1; color: #00796b; }
.status-degerlendiriliyor { background-color: #fff3e0; color: #f57c00; }
.status-revizyon { background-color: #ffebee; color: #d32f2f; }
.status-bekleniyor { background-color: #e3f2fd; color: #1976d2; }

/* FORMLAR */
form { margin-top: 20px; }
input[type="text"], input[type="password"], textarea, select {
    width: 100%;
    padding: 12px;
    border-radius: 5px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    margin-bottom: 10px;
    font-family: 'Poppins', sans-serif;
}
textarea { resize: vertical; min-height: 80px; }
button {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    transition: background 0.3s ease;
}
button:hover {
    background: #087a7d;
}

/* LOGIN SAYFASI */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    text-align: center;
}

/* TABLOLAR (ADMIN) */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th, .admin-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
}
.admin-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* GERİ BİLDİRİM */
.feedback-box {
    background: #f0f8ff;
    border: 1px solid #bde0fe;
    padding: 15px;
    margin-top: 15px;
    border-radius: 5px;
}
.feedback-box strong { color: var(--primary-color); }

/* YÖNETİCİ DASHBOARD STİLLERİ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}
.dashboard-item h3 {
    margin-top: 0;
    color: var(--primary-color);
}
.dashboard-metric {
    font-size: 3em;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 0;
}
.progress-container {
    margin-bottom: 10px;
}
.progress-bar {
    background-color: var(--light-gray);
    border-radius: 20px;
    height: 25px;
    overflow: hidden;
}
.progress-bar-inner {
    background-color: var(--success-color);
    color: white;
    height: 100%;
    text-align: center;
    line-height: 25px;
    font-weight: 600;
    transition: width 0.5s ease;
}

/* ÖĞRENCİ PANELİ STİLLERİ */
.ajans-header-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: start;
}
.aktif-gorev {
    background: var(--background-color);
    padding: 15px;
    border-radius: 5px;
    margin-top: 15px;
    border-left: 4px solid var(--secondary-color);
}
.deadline-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.deadline-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--light-gray);
}
.deadline-list li:last-child {
    border-bottom: none;
}
.announcement-box {
    background: #fff3e0;
    border-left: 4px solid #f57c00;
    padding: 15px;
    margin-top: 15px;
    border-radius: 5px;
}
.announcement-box p { margin: 0 0 5px 0; }
.announcement-box small { color: #555; }

/* YENİ GÖREV DETAY STİLLERİ */
.gorev-detay-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
    margin-bottom: 20px;
}
.gorev-bolumu {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}
.gorev-bolumu h4 {
    margin-top: 0;
    color: var(--primary-color);
    border-bottom: 2px solid var(--light-gray);
    padding-bottom: 10px;
    margin-bottom: 15px;
}
.checklist {
    list-style: none;
    padding-left: 0;
}
.checklist li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
}
.checklist li::before {
    content: '☐';
    position: absolute;
    left: 0;
    top: 0;
    font-size: 1.2em;
    color: var(--secondary-color);
}
.teslim-alani {
    background-color: #e3f2fd; /* Açık mavi arka plan */
    border: 1px solid #bbdefb;
}

/* YENİ ALT MADDE (CHECKLIST) STİLLERİ */
.madde-container {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-top: 15px;
    padding: 15px;
    background: #fff;
}
.madde-baslik {
    font-size: 1.1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.madde-detay {
    padding-left: 34px; /* ikon genişliği + gap */
    color: #555;
    font-size: 0.95em;
}
.madde-teslim-alani {
    padding-left: 34px;
    margin-top: 10px;
    border-top: 1px dashed #ddd;
    padding-top: 10px;
}
.madde-teslim-alani form {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}
.madde-teslim-alani input[type="file"] {
    width: auto;
    flex-grow: 1;
}
.status-icon svg {
    vertical-align: middle;
}
.button-danger {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

.ornek-proje-link {
    display: inline-block;
    margin: 5px 0 15px 0;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}
.ornek-proje-link svg {
    vertical-align: middle;
    margin-right: 5px;
}
.ornek-proje-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* YENİ HEADER VE MENÜ STİLLERİ */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
}

.main-nav {
    display: flex;
    gap: 15px;
}

.main-nav a {
    text-decoration: none;
    color: var(--font-color);
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.main-nav a:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logout-btn {
    text-decoration: none;
    background: var(--danger-color);
    color: white !important; /* Diğer a stillerini ezmek için */
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.logout-btn:hover {
    background: #c25035;
}

/* YENİ BUTON VE TABLO STİLLERİ */
.button-primary {
    display: inline-block;
    text-decoration: none;
    background-color: var(--primary-color);
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    font-weight: 600;
    text-align: center;
    transition: background 0.3s ease;
}
.button-primary:hover {
    background-color: #004c5a;
}
.button-secondary {
    display: inline-block;
    text-decoration: none;
    background-color: #6c757d;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    font-weight: 600;
    transition: background 0.3s ease;
}
.button-secondary:hover {
    background-color: #5a6268;
}

.admin-table.simple th {
    background-color: transparent;
    color: var(--font-color);
    font-weight: 600;
}
.admin-table.simple td, .admin-table.simple th {
    border: none;
    border-bottom: 1px solid var(--light-gray);
}

/* YENİ AKORDİYON STİLLERİ */
.accordion-header {
    background-color: #f8f9fa;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1.2em;
    font-weight: 600;
    color: var(--primary-color);
    transition: background-color 0.4s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 5px; /* Köşeleri yuvarlat */
    border: 1px solid #e9ecef;
}

.accordion-header:hover, .accordion-header.active {
    background-color: #e9ecef;
}

/* Ok ikonu için */
.accordion-header::after {
    content: '\25BC'; /* Aşağı ok Unicode karakteri */
    font-size: 0.8em;
    color: var(--secondary-color);
    transition: transform 0.3s ease;
}

.accordion-header.active::after {
    transform: rotate(180deg); /* Aktif olunca oku yukarı döndür */
}

.accordion-content {
    padding: 0 18px;
    background-color: white;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    border-left: 1px solid #e9ecef;
    border-right: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}

.asama-card {
    padding: 0; /* İç padding'i sıfırla, akordiyon yönetecek */
    border: none; /* Kenarlığı sıfırla */
    box-shadow: none; /* Gölgeyi sıfırla */
}

.yonetim-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    border-bottom: 1px solid var(--light-gray);
}
.yonetim-form div {
    display: flex;
    gap: 10px;
}

/* YENİ FOOTER STİLLERİ */
.main-footer {
    background-color: var(--primary-color); /* Ana menü ile aynı, tutarlı bir renk */
    color: #f0f8ff; /* Açık, okunabilir bir yazı rengi */
    text-align: center;
    padding: 1px 0;
    margin-top: 1px; /* Sayfa içeriği ile arasına boşluk koyar */
    width: 100%;
}

.main-footer p {
    margin: 1px 0;
    padding: 0;
}

.footer-credit {
    font-size: 0.85em;
    opacity: 0.7; /* Biraz daha soluk görünmesi için */
}

/* HEADER LOGO LİNKİ İÇİN STİL */
.logo a {
    color: inherit; /* Rengi parent element olan .logo'dan al (yani --primary-color) */
    text-decoration: none; /* Alt çizgiyi kaldır */
}

/* YENİ ESTETİK TASARIM STİLLERİ */
.accordion-header {
    border-radius: 8px; /* Daha yuvarlak köşeler */
}
.accordion-content {
    border-radius: 0 0 8px 8px; /* Alt köşeleri de yuvarlat */
    margin-top: -5px; /* Başlıkla birleşik görünmesi için */
    padding-top: 5px; /* Başlıkla birleşik görünmesi için */
}
.header-deadline {
    font-size: 0.8em;
    font-weight: normal;
    background-color: #fff;
    padding: 5px 10px;
    border-radius: 20px;
    color: var(--font-color);
    border: 1px solid var(--light-gray);
}
.header-deadline svg {
    margin-right: 5px;
    vertical-align: text-bottom;
}
.madde-container {
    border: none;
    border-top: 1px solid var(--light-gray);
    padding: 15px 0;
    margin: 0 15px;
}
.madde-container:last-child {
    border-bottom: none;
}
.madde-container.madde-onaylandi {
    opacity: 0.6; /* Tamamlanan görevleri soluklaştır */
    background-color: #f8f9fa;
}
.madde-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.madde-deadline {
    font-size: 0.9em;
    font-weight: 600;
    color: #555;
    display: flex;
    align-items: center;
    gap: 6px;
}
.madde-content {
    padding-left: 34px; /* ikon genişliği + gap */
}
.madde-detay {
    color: #555;
    font-size: 0.95em;
    margin-top: 5px;
}
.deadline-passed {
    background-color: #ffebee;
    color: #d32f2f;
    padding: 10px;
    border-radius: 5px;
    font-weight: 600;
    text-align: center;
}

/* AKORDİYON BAŞLIĞI HİZALAMA GÜNCELLEMESİ */
.accordion-header {
    display: flex;
    justify-content: space-between; /* Önemli: içeriği iki uca yaslar */
    align-items: center;
    width: 100%;
}

.accordion-title {
    flex-grow: 1; /* Başlığın mevcut alanı kaplamasını sağlar */
    text-align: left;
}

/* YENİ ESTETİK ALT GÖREV TASARIMI */
.madde-container {
    background-color: #fff;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    margin: 15px;
    transition: box-shadow 0.3s ease;
}
.madde-container:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
}
.madde-container.madde-onaylandi {
    background-color: #f8f9fa; /* Onaylananları hafif gri yap */
    opacity: 0.7;
}
.madde-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--light-gray);
}
.madde-baslik {
    font-size: 1.1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
}
.madde-deadline {
    font-size: 0.9em;
    font-weight: 600;
    color: #555;
    display: flex;
    align-items: center;
    gap: 6px;
}
.madde-content {
    padding: 15px;
}
.madde-detay {
    color: #555;
    font-size: 0.95em;
    margin-top: 0;
    margin-bottom: 15px;
}
.madde-teslim-alani {
    background-color: #f8f9fa;
    border: 1px dashed #ddd;
    border-radius: 5px;
    padding: 15px;
}
.teslim-bilgisi {
    margin-bottom: 10px;
}
.upload-form {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 0;
}
.upload-form input[type="file"] {
    width: auto;
    flex-grow: 1;
}
.deadline-passed {
    background-color: #ffebee;
    color: #d32f2f;
    padding: 10px;
    border-radius: 5px;
    font-weight: 600;
    text-align: center;
}

/* ==========================================================================
   RESPONSIVE TASARIM (MOBİL UYUMLULUK) - NİHAİ SÜRÜM v2
   ========================================================================== */
@media (max-width: 768px) {

    .container {
        width: 90%;
        padding: 15px;
    }

    /* Header'ı Dikey Hale Getir */
    .main-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    .main-nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    .user-info {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }
    .logout-btn {
        width: 100%;
        text-align: center;
    }

    /* İki Sütunlu Gridleri Tek Sütuna Düşür */
    .dashboard-grid,
    .ajans-header-grid {
        grid-template-columns: 1fr;
    }
    
    .ajans-header-grid {
        align-items: stretch;
    }

    /* Akordiyon Başlığını Düzenle */
    .accordion-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .accordion-header::after {
        align-self: flex-end;
        margin-top: -25px;
    }
    
    /* ----- YENİ TABLO DÜZELTMELERİ BAŞLANGIÇ ----- */

    /* Genel Tablo Davranışı */
    .admin-table thead {
        display: none; /* Mobil ekranda başlık satırını gizle */
    }
    .admin-table, .admin-table tbody, .admin-table tr, .admin-table td {
        display: block; /* Her elemanı bir blok gibi davranmaya zorla */
        width: 100%;
        box-sizing: border-box;
    }
    .admin-table tr {
        margin-bottom: 15px; /* Her satır arasına boşluk koy */
        border: 1px solid var(--light-gray);
        border-radius: 5px;
    }
    .admin-table td {
        text-align: right; /* İçeriği sağa yasla */
        position: relative;
        padding-left: 50%; /* Sol tarafta başlık için yer aç */
        border-bottom: 1px solid var(--light-gray);
    }
    .admin-table td:last-child {
        border-bottom: none;
    }
    .admin-table td::before {
        content: attr(data-label); /* data-label özelliğini başlık olarak kullan */
        position: absolute;
        left: 10px;
        width: calc(50% - 20px);
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
    }

    /* Ajans İlerleme Tablosu için Özel Ayarlar */
    .admin-table.simple td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-left: 15px;
    }
     .admin-table.simple td::before {
        position: static;
        width: auto;
        padding-right: 10px;
    }
    .admin-table.simple td .progress-bar {
        width: 50%;
    }
    
    /* Yönetim sayfalarındaki İşlem butonlarını düzenle */
    .admin-table td div.action-buttons, .admin-table td form {
        display: flex;
        justify-content: flex-end; /* Butonları sağa yasla */
        gap: 10px;
        padding-top: 10px;
    }
    
    /* ----- YENİ TABLO DÜZELTMELERİ BİTİŞ ----- */

    /* Alt görev başlık ve tarihini dikey hizala */
    .madde-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* Dosya yükleme formunu dikey hale getir */
    .upload-form {
        flex-direction: column;
        align-items: stretch;
    }
    .upload-form input[type="file"] {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Örnek proje sayfasındaki sekmeler ve görseller */
    .ornek-proje-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
    .ornek-gorseller {
        grid-template-columns: 1fr;
    }
    .ornek-gorseller img {
        width: 100%;
        height: auto;
    }
}