/* --- MASAÜSTÜ MODAL (DEĞİŞMEDİ) --- */
.modal {
    display: none; 
    position: fixed;
    z-index: 99999; /* En üst katman */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(145deg, #1a1a20, #0a0a0e);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 90%;
    max-width: 800px;
    border-radius: 15px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    position: relative;
    animation: modalZoom 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

@keyframes modalZoom {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 20;
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--accent-color);
}

.modal-body {
    display: flex;
    flex-direction: row;
}

.modal-image {
    flex: 1;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.modal-image img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 5px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.modal-details {
    flex: 1.5;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-details h2 {
    margin-top: 0;
    color: var(--accent-color);
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    margin-bottom: 10px;
}

.modal-desc {
    color: #ccc;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.link-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.modal-link {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.modal-link:hover {
    background: var(--accent-color);
    color: black;
    border-color: var(--accent-color);
}

/* --- MOBİL BOTTOM SHEET (FIXED) --- */
@media (max-width: 768px) {
    .modal {
        /* Tüm Flex/Block karmaşasını unut. Mobilde Fixed Overlay. */
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0; /* Kesinlikle aşağı kadar uzanmalı */
        width: 100%;
        height: 100vh; /* %100 yerine 100vh daha güvenli */
        background: rgba(0,0,0,0.6); /* Arka plan karartı */
        z-index: 999999; /* Header'ın (1000) çok üstünde */
        align-items: flex-end; /* İçeriği en alta it */
        justify-content: center;
        padding: 0;
        border: none;
    }

    .modal.show {
        display: flex !important; /* Açılınca Flex olsun */
        opacity: 1 !important;
    }

    .modal-content {
        /* Panel Ayarları */
        width: 100%;
        max-width: 100%;
        max-height: 85vh;
        border-radius: 24px 24px 0 0;
        background: #181818;
        box-shadow: 0 -5px 30px rgba(0,0,0,0.8);
        
        /* Animasyon */
        animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        transform: translateY(100%); /* Başlangıç */
        
        /* Düzen */
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        
        position: absolute; /* Önceki Relative yerine Absolute */
        bottom: 0;
        left: 0;
        width: 100%; /* Tam genişlik */
        
        margin: 0;
        border: 1px solid rgba(255,255,255,0.1);
        border-bottom: none;
    }

    @keyframes slideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    /* Tutamaç */
    .modal-content::before {
        content: '';
        min-height: 5px;
        width: 50px;
        background: rgba(255,255,255,0.2);
        margin: 15px auto 10px auto;
        border-radius: 10px;
        flex-shrink: 0;
    }

    .modal-body {
        flex-direction: column;
        padding: 0 20px 40px 20px;
    }

    .modal-image {
        padding: 0;
        background: transparent;
        border: none;
        margin-bottom: 15px;
    }
    
    .modal-image img {
        max-height: 180px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    }

    .modal-details {
        padding: 0;
        text-align: left;
    }

    .modal-details h2 {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }

    .modal-desc {
        font-size: 0.85rem;
        color: #aaa;
        margin-bottom: 20px;
    }

    .close-modal {
        top: 15px;
        right: 15px;
        background: rgba(255,255,255,0.1);
        width: 32px;
        height: 32px;
        line-height: 32px;
        font-size: 20px;
        border-radius: 50%;
        text-align: center;
    }
    
    .link-container {
        gap: 8px;
    }
    
    .modal-link {
        flex: 1;
        text-align: center;
        padding: 12px 5px;
        font-size: 0.8rem;
        white-space: nowrap;
    }
}

