:root {
    --primary-color: #A67B5B; /* Mat Altın/Kahve */
    --primary-hover: #8E684C;
    --bg-color: #F9F7F2;     /* Krem */
    --card-bg: rgba(255, 255, 255, 0.95); /* Buzlu cam için transparan */
    --text-main: #2D3436;
    --text-light: #636E72;
    --border-color: #E0E0E0;
    --success-color: #27AE60;
    --error-color: #D63031;
    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Montserrat', sans-serif;
    --shadow-soft: 0 15px 35px rgba(166, 123, 91, 0.15);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding: 15px;
}

/* --- 1. ARKA PLAN KALP EFEKTLERİ --- */
.background-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.heart {
    position: absolute;
    bottom: -10vh;
    background: rgba(166, 123, 91, 0.15);
    display: inline-block;
    width: 20px;
    height: 20px;
    transform: rotate(45deg);
    animation: floatUp linear infinite;
}

.heart::before, .heart::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
}

.heart::before { left: -50%; }
.heart::after { top: -50%; }

/* --- 2. ANA KAPLAYICI (Main Wrapper) --- */
.main-wrapper {
    width: 100%;
    max-width: 500px;
    background: var(--card-bg);
    padding: 3rem 2rem;
    border-radius: 30px;
    box-shadow: var(--shadow-soft);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    z-index: 10;
    animation: slideUp 0.8s ease-out;
    margin: 1rem;
}

/* --- 3. HEADER & LOGO --- */
.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.logo {
    width: 85px;
    height: 85px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    
    /* Flexbox ile tam ortalama */
    display: flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
    
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    background: #fff;
    margin-bottom: 1.2rem;
    
    /* Nabız Animasyonu */
    animation: heartbeat 3s infinite ease-in-out;
    box-shadow: 0 0 20px rgba(166, 123, 91, 0.2);
}

h1 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--text-main);
    line-height: 1.1;
    margin-bottom: 0.3rem;
}

.subtitle {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.intro-text {
    font-size: 0.95rem;
    color: var(--text-light);
}

/* --- 4. FORM & UPLOAD ALANI --- */
.name-input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.name-label {
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 600;
    margin-left: 5px;
    margin-bottom: 5px;
    display: block;
}

.name-input {
    width: 100%;
    padding: 1rem;
    border: 1px solid #DDD;
    border-radius: 15px;
    font-family: var(--font-body);
    font-size: 1rem;
    background: #FAFAFA;
    transition: var(--transition);
}

.name-input:focus {
    border-color: var(--primary-color);
    background: #FFF;
    outline: none;
    box-shadow: 0 4px 15px rgba(166, 123, 91, 0.1);
    transform: translateY(-2px);
}

.upload-area {
    border: 2px dashed #DCCBC1;
    border-radius: 20px;
    padding: 2.5rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    background: #FFFEFC;
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: #FFF;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transform: scale(1.02);
}

.upload-icon {
    color: var(--primary-color);
    margin-bottom: 0.8rem;
    transition: transform 0.3s;
}

.upload-area:hover .upload-icon {
    transform: scale(1.2) rotate(-10deg);
}

.upload-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.upload-desc { font-size: 0.85rem; color: var(--text-light); }

#file-input { 
    position: absolute; width: 100%; height: 100%; top: 0; left: 0; opacity: 0; cursor: pointer; 
}

/* --- 5. PROGRESS BAR --- */
.upload-progress-container {
    margin-top: 1.5rem;
    background: #fff;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid #eee;
}

.progress-info {
    display: flex; justify-content: space-between; font-size: 0.85rem; 
    font-weight: 600; color: var(--primary-color); margin-bottom: 0.5rem;
}

.progress-bar-bg {
    height: 8px; background: #eee; border-radius: 4px; overflow: hidden;
}

.progress-bar-fill {
    height: 100%; background: var(--primary-color); width: 0%; 
    transition: width 0.3s ease; border-radius: 4px;
}

.current-file {
    font-size: 0.8rem; color: var(--text-light); margin-top: 0.5rem; 
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center;
}

/* --- 6. BUTONLAR VE MESAJLAR --- */
.btn-refresh, .login-btn {
    background: linear-gradient(135deg, var(--primary-color), #8E684C);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(142, 104, 76, 0.3);
    transition: var(--transition);
    font-family: var(--font-body);
}

.btn-refresh:hover, .login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(142, 104, 76, 0.4);
}

.success-message { text-align: center; padding: 2rem 0; animation: slideUp 0.5s; }
.success-icon { font-size: 3rem; color: var(--success-color); margin-bottom: 0.5rem; }
.error-message { 
    margin-top: 1rem; padding: 1rem; background: #FEF2F2; 
    border: 1px solid #FCA5A5; color: var(--error-color); border-radius: 12px; 
    font-size: 0.9rem; text-align: center; animation: shake 0.4s;
}
.name-error { color: var(--error-color); font-size: 0.8rem; margin-top: 5px; display: none; }

/* --- 7. GALERİ SAYFASI STİLLERİ (GERİ EKLENDİ) --- */
.gallery-container {
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    /* Galeri sayfası için wrapper genişliğini iptal et */
}

/* Galeride wrapper stili ezilmesin diye body>div kontrolü */
body > .gallery-container {
    align-items: flex-start;
}

.gallery-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem;
    padding-bottom: 1rem; border-bottom: 1px solid #eee;
}

.user-group {
    background: #fff; padding: 1.5rem; border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05); margin-bottom: 2rem;
}

.user-header {
    display: flex; align-items: center; margin-bottom: 1.5rem;
    padding-bottom: 0.5rem; border-bottom: 1px solid #f0f0f0;
}

.user-avatar {
    width: 45px; height: 45px; background: var(--primary-color);
    color: #fff; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-weight: bold; margin-right: 1rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.gallery-card {
    position: relative; border-radius: 12px; overflow: hidden;
    aspect-ratio: 1; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s; cursor: pointer;
}

.gallery-card:hover { transform: scale(1.03); z-index: 2; }
.gallery-card img { width: 100%; height: 100%; object-fit: cover; display: block; }

.select-box { position: absolute; top: 10px; left: 10px; z-index: 5; }
.gallery-checkbox { width: 20px; height: 20px; cursor: pointer; accent-color: var(--primary-color); }

.card-download {
    position: absolute; bottom: 10px; right: 10px;
    background: rgba(255,255,255,0.95); width: 32px; height: 32px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: #333; text-decoration: none; font-size: 1.2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.ip-badge {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: rgba(0,0,0,0.6); color: #fff; font-size: 0.65rem;
    padding: 2px; text-align: center; opacity: 0; transition: opacity 0.2s;
}
.gallery-card:hover .ip-badge { opacity: 1; }

.btn-action {
    background: var(--primary-color); color: #fff; border: none;
    padding: 0.6rem 1.2rem; border-radius: 8px; cursor: pointer;
    font-size: 0.9rem; font-family: var(--font-body);
}

.btn-logout {
    border: 1px solid var(--error-color); color: var(--error-color);
    padding: 0.6rem 1.2rem; border-radius: 8px; text-decoration: none; font-size: 0.9rem;
}
.btn-logout:hover { background: var(--error-color); color: #fff; }

/* --- 8. LOGIN SAYFASI --- */
.login-container { text-align: left; }
.login-form input {
    width: 100%; padding: 1rem; margin-bottom: 1rem;
    border: 1px solid #ddd; border-radius: 12px; outline: none;
}
.login-form input:focus { border-color: var(--primary-color); }

/* --- 9. LIGHTBOX --- */
.lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95); z-index: 2000;
    display: none; justify-content: center; align-items: center;
    backdrop-filter: blur(5px);
}
.lightbox.active { display: flex; }
.lightbox-content { position: relative; max-width: 90%; text-align: center; }
.lightbox img { max-width: 100%; max-height: 80vh; border-radius: 8px; box-shadow: 0 0 30px rgba(0,0,0,0.5); }
.lightbox-close { position: absolute; top: -40px; right: 0; color: #fff; font-size: 2.5rem; cursor: pointer; }
.lightbox-download {
    display: inline-block; margin-top: 15px; background: #fff;
    color: #000; padding: 10px 30px; border-radius: 30px;
    text-decoration: none; font-weight: bold;
}

/* --- 10. ANİMASYON KEYFRAMES --- */
@keyframes heartbeat {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(166, 123, 91, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(166, 123, 91, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(166, 123, 91, 0); }
}

@keyframes floatUp {
    0% { transform: translateY(0) rotate(45deg) scale(0.5); opacity: 0; }
    20% { opacity: 0.6; }
    100% { transform: translateY(-120vh) rotate(45deg) scale(1.2); opacity: 0; }
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake { animation: shake 0.4s ease-in-out; }

/* --- 11. MOBİL UYUM --- */
@media (max-width: 768px) {
    .main-wrapper { margin: 10px; padding: 2rem 1.5rem; }
    h1 { font-size: 1.8rem; }
    .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 5px; } 
    /* Mobilde galeri 3'lü olsun */
}

@media (max-width: 480px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); } 
    /* Çok küçük ekranda 2'li */
    .header { margin-bottom: 1.5rem; }
}