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

:root {
    --bg-dark: #120e16;
    --bg-light: #221c2c;
    --primary-gold: #e0b873;
    --text-light: #e0e0e0;
    --text-dark: #a0a0a0;
    --border-color: rgba(224, 184, 115, 0.2);
    --success-color: #32a852;
    --glow-color: rgba(224, 184, 115, 0.4);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Lato', sans-serif;
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.05) 1px, transparent 0);
    background-size: 25px 25px;
    color: var(--text-light);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

.container {
    background: var(--bg-light);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 0 0 25px var(--glow-color);
    text-align: center;
    max-width: 600px;
    width: 100%;
    border: 1px solid var(--border-color);
    transition: all 0.5s ease;
}

h1 {
    font-family: 'Cinzel', serif;
    color: var(--primary-gold);
    font-size: 2.8em;
    margin: 0 0 10px 0;
    letter-spacing: 2px;
    text-shadow: 0 3px 15px var(--glow-color);
}

.subtitle {
    color: var(--text-dark);
    margin-bottom: 40px;
    font-weight: 300;
}

.form-group {
    margin-bottom: 25px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 400;
    color: var(--text-dark);
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Dosya Yükleme Alanı */
input[type="file"] {
    display: none;
}

.file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 20px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-dark);
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.file-label:hover {
    border-color: var(--primary-gold);
    background-color: #2a2536;
    transform: scale(1.02);
}

.file-label i {
    margin-right: 15px;
    font-size: 1.2em;
    color: var(--primary-gold);
}

.gorsel-ipucu {
    display: block;
    text-align: center;
    margin-top: 10px;
    font-style: italic;
    color: var(--text-dark);
    font-size: 0.85em;
}

/* Select2 Stil Düzenlemeleri */
.select2-container {
    width: 100% !important;
}

.select2-container--custom-theme .select2-selection--single {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    height: 50px;
    outline: none;
    display: flex;
    align-items: center;
}

.select2-container--custom-theme .select2-selection--single:focus {
    border-color: var(--primary-gold);
}

.select2-container--custom-theme .select2-selection--single .select2-selection__rendered {
    color: var(--text-light);
    padding-left: 20px;
}

.select2-container--custom-theme .select2-selection--single .select2-selection__arrow {
    height: 100%;
    position: absolute;
    top: 1px;
    right: 10px;
}

.select2-container--custom-theme .select2-selection--single .select2-selection__arrow b {
    border-color: var(--primary-gold) transparent transparent transparent;
    border-width: 6px 6px 0 6px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.select2-dropdown {
    background-color: var(--bg-dark);
    border: 1px solid var(--primary-gold);
    border-radius: 8px;
}

.select2-results__option--highlighted {
    background-color: #2a2536;
}

.select2-results__option {
    color: var(--text-light);
}

#image-preview-container {
    margin: 20px 0;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    background: var(--bg-dark);
}

#image-preview {
    max-width: 100%;
    max-height: 250px;
    border-radius: 5px;
}

button {
    background: linear-gradient(45deg, var(--primary-gold), #c89b5c);
    color: var(--bg-dark);
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    font-family: 'Cinzel', serif;
    width: 100%;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
}

button:hover:not(:disabled) {
    box-shadow: 0 5px 20px var(--glow-color);
    transform: translateY(-3px);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Yükleme Yazısı ve Sonuç */
#loading-text-container {
    padding: 40px 0;
}

.loading-text {
    font-family: 'Cinzel', serif;
    font-size: 1.5em;
    color: var(--primary-gold);
    animation: pulse 1.5s infinite ease-in-out;
    display: inline-block;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.sonuc-kutusu {
    margin-top: 30px;
    padding: 30px;
    border-radius: 10px;
    background-color: rgba(18, 14, 22, 0.7);
    text-align: left;
    line-height: 1.8;
    font-weight: 300;
    border: 1px solid var(--border-color);
    max-height: 400px;
    overflow-y: auto;
}

.sonuc-kutusu h3 {
    font-family: 'Cinzel', serif;
    color: var(--primary-gold);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin: 20px 0 15px 0;
    letter-spacing: 1px;
}

.sonuc-kutusu strong {
    color: #f5deb3;
    font-weight: bold;
}

.cursor {
    display: inline-block;
    background-color: var(--primary-gold);
    width: 10px;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        background-color: transparent;
    }
}

/* Aksiyon Butonları */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.action-buttons button {
    font-family: 'Lato', sans-serif;
    text-transform: none;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-grow: 1;
}

#reset-btn {
    background: transparent;
    color: var(--primary-gold);
    border: 1px solid var(--primary-gold);
}

/* Fal Geçmişi Butonu ve Modal */
.history-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-light);
    color: var(--primary-gold);
    border: 1px solid var(--border-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2em;
    z-index: 1001;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-btn:hover {
    background: var(--primary-gold);
    color: var(--bg-dark);
    transform: scale(1.1);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-light);
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2em;
    color: var(--text-dark);
    cursor: pointer;
}

#history-list {
    margin-top: 20px;
}

.history-item {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
}

.history-header {
    background: var(--bg-dark);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-header small {
    color: var(--text-dark);
}

.history-content {
    padding: 15px;
    line-height: 1.7;
    background: rgba(18, 14, 22, 0.5);
}

.delete-btn {
    background: none;
    border: none;
    color: #ff6b6b;
    font-size: 1.5em;
    cursor: pointer;
}

.empty-history {
    color: var(--text-dark);
    padding: 20px 0;
}

.hidden {
    display: none !important;
}

/* --- RESPONSIVE TASARIM --- */
@media (max-width: 650px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
    }

    h1 {
        font-size: 2em;
    }

    .subtitle {
        margin-bottom: 30px;
    }

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

    .history-btn {
        top: 10px;
        right: 10px;
    }
}