/* Genel Stil Ayarları */
:root {
    --primary-color: #4CAF50;
    --secondary-color: #81C784;
    --background-color: #f4f7f6;
    --card-background: #ffffff;
    --text-color: #333;
    --light-text-color: #666;
    --border-color: #ddd;
    --progress-bg: #e0e0e0;
    --countdown-color: #FF5722;
    --danger-color: #dc3545;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: auto;
}

/* YENİ STİLLER */
.login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-align: center;
}

.danger-btn {
    background-color: var(--danger-color) !important;
    border-color: var(--danger-color) !important;
}

    .danger-btn:hover {
        background-color: #c82333 !important;
    }

.header-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}
/* YENİ STİLLER SONU */

/* Ana sayfa aksiyonları */
#header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#app-logo {
    max-height: 50px;
    width: auto;
}

.main-action-btn {
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    border: 2px solid var(--primary-color);
    background-color: var(--primary-color);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

#admin-login-link {
    color: var(--light-text-color);
    font-size: 14px;
    text-decoration: none;
}

    #admin-login-link:hover {
        text-decoration: underline;
    }

/* Sayfa Geri Butonu ve Buton Konumlandırma */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap; /* Sığmazsa alt satıra geçmesini sağlar */
    margin-bottom: 20px;
    position: relative;
    gap: 15px; /* Öğeler arasında boşluk bırakır */
}

    .header h2 {
        margin: 0;
        flex-grow: 1;
        text-align: center;
        width: 100%;
    }

    .header .back-btn {
        left: 0;
    }

.back-btn {
    padding: 8px 15px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
    background-color: #6c757d; /* Dikkat çekici gri tonu */
    color: white;
    border: none;
    flex-shrink: 0;
}

    .back-btn:hover {
        background-color: #5a6268; /* Üzerine gelince koyulaşma efekti */
    }

.action-buttons-container {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    width: 100%; /* Mobil görünümde tam genişlik kaplar */
    justify-content: center;
}

/* Sekme (Tab) Menüsü */
#tabs {
    display: flex;
    justify-content: space-around;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 15px 0;
    font-size: 16px;
    font-weight: bold;
    color: var(--light-text-color);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .tab-btn.active {
        color: var(--primary-color);
        border-bottom-color: var(--primary-color);
    }

/* Alan (Section) Stilleri */
.app-page, .tab-content {
    background-color: var(--card-background);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

h2, h3 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary-color);
}

/* Form Stilleri */
.form-container {
    margin-bottom: 20px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    text-align: left;
}

    .form-group label {
        display: block;
        margin-bottom: 6px;
        font-weight: 600;
        font-size: 14px;
        color: var(--light-text-color);
    }

.form-row {
    display: flex;
    gap: 15px;
}

    .form-row .form-group {
        flex: 1;
    }

input, select, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

    input:focus, select:focus, textarea:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
    }

button {
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px;
}

    button:hover {
        background-color: var(--secondary-color);
    }

/* Liste ve Kart Stilleri */
.list-container {
    margin-top: 20px;
}

.search-input {
    margin-bottom: 15px;
}

.list-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.past-event {
    opacity: 0.7;
    background-color: #f8f9fa;
}

    .past-event h4 {
        color: var(--danger-color);
    }

    .past-event .list-item-actions button {
        opacity: 0.6;
    }

.list-item:hover {
    background-color: #f2f2f2;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item h4 {
    margin: 0;
    font-size: 18px;
    color: var(--primary-color);
    width: 100%;
    margin-bottom: 5px;
}

.list-item p {
    margin: 0;
    font-size: 14px;
    color: var(--light-text-color);
    width: 100%;
}

.list-item-info {
    flex-grow: 1;
}

.list-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 0;
    flex-wrap: nowrap;
    align-items: center;
}

    .list-item-actions button {
        padding: 8px 12px;
        font-size: 14px;
    }

.action-buttons {
    display: flex;
    gap: 8px;
}

.list-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

    .list-controls .search-input {
        flex-grow: 1;
        margin-bottom: 0;
    }

    .list-controls .form-group {
        flex-shrink: 0;
    }


/* Dashboard Kartları */
.stats-card {
    background-color: var(--card-background);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

    .stats-card hr {
        border: none;
        border-top: 1px solid #f0f0f0;
        margin: 15px 0;
    }

.stat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

    .stat-item:last-child {
        border-bottom: none;
    }

.event-image-wrapper {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--secondary-color);
    display: flex;
    justify-content: center;
    align-items: center;
}

.event-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
}

.event-info-dashboard {
    flex-grow: 1;
}

.stat-name {
    margin-bottom: 2px;
    font-weight: bold;
}

.event-date-text {
    font-size: 13px;
    color: var(--light-text-color);
    margin-top: 0;
    margin-bottom: 8px;
}

.stat-value {
    color: var(--primary-color);
    font-weight: bold;
    text-align: right;
    margin-top: 8px;
    font-size: 15px;
}

.guest-stats {
    display: flex;
    gap: 20px;
    margin: 8px 0;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.guest-stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.guest-icon {
    font-size: 1.5em;
}

.guest-info .label {
    font-size: 12px;
    color: var(--light-text-color);
}

.guest-info .count {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-color);
}


.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
    width: 100%;
}

.progress-bar {
    flex-grow: 1;
    max-width: 150px;
    background-color: var(--progress-bg);
    border-radius: 5px;
    overflow: hidden;
    height: 8px;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.5s ease;
}

.fill-percentage {
    font-size: 12px;
    font-weight: bold;
    color: var(--primary-color);
    white-space: nowrap;
}

.countdown-timer {
    font-weight: bold;
    color: var(--countdown-color);
    text-align: left;
    width: 100%;
    margin-top: 5px;
}

/* Modal Stilleri */
.modal {
    display: none;
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

    .modal.active {
        display: flex;
    }

.modal-content {
    background-color: var(--card-background);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

    .modal-content h3 {
        margin-bottom: 15px;
        color: var(--primary-color);
    }

    .modal-content .form-group {
        margin-bottom: 15px;
    }

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

    .modal-actions button {
        flex-grow: 1;
        margin: 0;
    }

.modal-confirm-btn {
    background-color: #f44336;
}

    .modal-confirm-btn:hover {
        background-color: #d32f2f;
    }

.modal-cancel-btn {
    background-color: var(--light-text-color);
}

    .modal-cancel-btn:hover {
        background-color: #555;
    }

/* Tablo Stilleri */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 14px;
}

th, td {
    border: 1px solid var(--border-color);
    padding: 12px 8px;
    text-align: left;
    vertical-align: middle;
    word-wrap: break-word;
}

    th.center, td.center {
        text-align: center;
    }

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

th {
    font-weight: bold;
}

tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.status-icon {
    font-size: 20px;
    display: block;
    text-align: center;
}

.status-select, .list-control-select {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: #fff;
    width: auto;
    min-width: 110px;
}

.details-summary-box {
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

    .details-summary-box p {
        display: flex;
        justify-content: space-between;
        font-size: 15px;
        margin: 8px 0;
    }

        .details-summary-box p strong {
            color: var(--text-color);
        }

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 20px;
}

.page-btn {
    padding: 8px 12px;
    font-size: 14px;
    margin: 0;
    background-color: #fff;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

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

    .page-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }


/* Tablet ve Masaüstü Uyumu */
@media (min-width: 600px) {
    body {
        padding: 50px;
    }

    .container {
        padding: 40px;
    }

    /* ===== MASAÜSTÜ GÖRÜNÜM İÇİN YENİ VE SAĞLAM KURALLAR ===== */
    .header .back-btn {
        flex: 1 0 0; /* Sol taraf için 1 birimlik alan */
        text-align: left;
    }

    .header h2 {
        flex: 2 0 0; /* Orta başlık için 2 birimlik, daha geniş alan */
        text-align: center;
        width: auto;
    }

    .action-buttons-container {
        flex: 1 0 0; /* Sağ taraf için 1 birimlik alan */
        justify-content: flex-end; /* Butonları bu alanın sağına yaslar */
        width: auto;
        flex-wrap: nowrap;
    }
    /* ======================================================= */

    #tabs {
        justify-content: center;
    }

    .tab-btn {
        padding: 15px 30px;
    }

    .form-container, .list-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    form {
        width: 100%;
        max-width: 600px;
    }

    .stats-card {
        width: 100%;
        margin-right: 0;
    }
}

/* MOBİL CİHAZLAR İÇİN ÖZEL STİLLER (599px ve altı) */
@media (max-width: 599px) {
    body {
        padding: 10px;
    }

    .app-page, .tab-content, .container {
        padding: 10px;
    }

    #app-logo {
        max-height: 40px;
    }

    .header {
        justify-content: center; /* İçeriği merkezler */
    }

        .header .back-btn {
            position: static; /* Geri butonunun pozisyonunu sıfırlar */
            order: -2; /* En sola alır */
        }

        .header h2 {
            order: -1; /* Başlığı geri butondan sonra ortaya alır */
            padding: 0 20px; /* Kenarlarda boşluk bırakır */
        }

    .action-buttons-container {
        order: 1; /* Buton grubunu en alta alır */
        flex-wrap: wrap; /* Butonların sığmazsa aşağı kaymasını sağlar */
        gap: 8px;
    }

        .action-buttons-container .main-action-btn {
            flex-basis: 48%; /* Butonların yaklaşık yarım genişlikte olmasını sağlar */
            flex-grow: 1;
            font-size: 13px;
            padding: 10px 5px; /* İç boşluğu ayarlar */
        }


    .form-group input.flatpickr-input {
        background-color: white;
    }

    #event-reservations-list table,
    #event-reservations-list thead,
    #event-reservations-list tbody,
    #event-reservations-list th,
    #event-reservations-list td,
    #event-reservations-list tr {
        display: block;
    }

    #event-reservations-list thead {
        display: none;
    }

    #event-reservations-list tr {
        border: 1px solid var(--border-color);
        margin-bottom: 15px;
        border-radius: 8px;
        padding: 10px;
    }

    #event-reservations-list td {
        border: none;
        border-bottom: 1px solid #f0f0f0;
        position: relative;
        padding: 12px 5px 12px 50%;
        text-align: right;
        min-height: 34px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

        #event-reservations-list td:before {
            content: attr(data-label);
            position: absolute;
            left: 10px;
            width: 45%;
            padding-right: 10px;
            white-space: nowrap;
            text-align: left;
            font-weight: bold;
            color: var(--text-color);
        }

        #event-reservations-list td:last-child {
            border-bottom: none;
            padding-left: 10px;
            justify-content: space-between;
        }

            #event-reservations-list td:last-child:before {
                display: none;
            }

    .list-item-actions {
        width: 100%;
    }

    .action-buttons {
        display: flex;
        gap: 5px;
    }

    .list-item-actions button {
        padding: 6px;
        font-size: 14px;
        line-height: 1;
    }

    .status-select {
        padding: 4px;
        font-size: 12px;
        min-width: auto;
        width: 100px;
    }

    .status-icon {
        font-size: 18px;
        margin-right: auto;
    }

    .list-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
}

/* Bildirim (Toast) Mesajları Stilleri */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.toast {
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(100%);
    animation: slideInAndFadeOut 3.5s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast--success {
    background-color: var(--primary-color);
}

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

@keyframes slideInAndFadeOut {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }

    15%, 85% {
        opacity: 1;
        transform: translateX(0);
    }

    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* YENİ EKLENEN NOT SATIRI STİLİ */
.note-row td {
    padding: 8px 15px !important;
    font-size: 13px;
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--border-color) !important;
    color: #555;
    font-style: italic;
    text-align: left !important;
    justify-content: flex-start !important;
}