/**
 * Tostland - Ana Sayfa Stilleri
 * 
 * Bu dosya Tostland'ın ana sayfası için tüm stilleri içerir.
 * Mobil uyumlu, erişilebilir ve modern bir tasarım sunar.
 */

/* ========================================
   CSS DEĞİŞKENLERİ (DESIGN TOKENS)
   ======================================== */
:root {
    /* Renkler */
    --primary-orange: #ff8c00;
    --primary-orange-light: #ffb347;
    --primary-orange-dark: #e67e00;
    --primary-dark: #0f0f10;
    --primary-gray: #1c1c20;
    --text-light: #f5f5f5;
    --text-muted: #b0b0b0; /* WCAG uyumlu - daha açık yapıldı */
    --text-gray: #888888;
    --success-color: #4caf50;
    --success-light: #8be58b;
    --error-color: #f44336;
    --error-light: #ff6b6b;
    
    /* Boyutlar */
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --border-radius-lg: 24px;
    --border-radius-full: 999px;
    
    /* Geçişler */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
    
    /* Gölgeler */
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 14px 35px rgba(0, 0, 0, 0.75);
    
    /* Z-index katmanları */
    --z-nav: 100;
    --z-mobile-menu: 150;
    --z-overlay: 140;
}

/* ========================================
   RESET VE TEMEL STİLLER
   ======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #202028 0, #050507 55%, #000 100%);
    color: var(--text-light);
    min-height: 100vh;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* Focus görünürlüğü - erişilebilirlik için */
:focus-visible {
    outline: 2px solid var(--primary-orange);
    outline-offset: 2px;
}

/* ========================================
   LAYOUT
   ======================================== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ========================================
   NAVİGASYON
   ======================================== */
nav {
    position: sticky;
    top: 0;
    z-index: var(--z-nav);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    background: rgba(5, 5, 7, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    font-weight: 800;
    letter-spacing: 0.05em;
    font-size: 1.1rem;
    text-transform: uppercase;
    color: var(--primary-orange);
    transition: opacity var(--transition-fast);
}

.logo:hover {
    opacity: 0.85;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.nav-links a {
    color: var(--text-muted);
    position: relative;
    padding-bottom: 4px;
    transition: color var(--transition-fast);
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--primary-orange);
    transition: width var(--transition-fast);
}

.nav-links a:hover,
.nav-links a:focus {
    color: var(--text-light);
}

.nav-links a:hover::after,
.nav-links a:focus::after {
    width: 100%;
}

/* Hamburger Menü Butonu */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: var(--z-mobile-menu);
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-light);
    border-radius: 2px;
    transition: all var(--transition-medium);
}

.hamburger-line + .hamburger-line {
    margin-top: 6px;
}

/* Hamburger aktif durumu */
.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* Mobil Menü Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: var(--z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-medium), visibility var(--transition-medium);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
    padding: 4rem 1.5rem 3rem;
    text-align: center;
}

.hero h1 {
    font-size: clamp(2.1rem, 4vw, 2.8rem);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero p {
    max-width: 600px;
    margin: 0.5rem auto 1.5rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* CTA Butonu */
.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.6rem;
    border-radius: var(--border-radius-full);
    background: linear-gradient(135deg, var(--primary-orange-light), var(--primary-orange));
    color: #161616;
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
}

.cta-button:hover,
.cta-button:focus {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    opacity: 0.95;
}

.cta-button:active {
    transform: translateY(0);
}

.cta-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   RASTGELE TOST SECTION
   ======================================== */
.random-tost-section {
    padding: 2rem 0;
    background: linear-gradient(180deg, transparent 0%, rgba(255, 140, 0, 0.03) 50%, transparent 100%);
}

.random-tost-wrapper {
    text-align: center;
}

.random-tost-wrapper h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--primary-orange);
}

.random-tost-card {
    background: rgba(13, 13, 18, 0.95);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto 1rem;
    border: 1px solid rgba(255, 140, 0, 0.15);
    box-shadow: var(--shadow-lg);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: border-color var(--transition-fast);
}

.random-tost-card:hover {
    border-color: rgba(255, 140, 0, 0.3);
}

.random-tost-text {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.random-tost-author {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.refresh-btn {
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius-full);
    background: rgba(255, 140, 0, 0.15);
    border: 1px solid rgba(255, 140, 0, 0.4);
    color: var(--text-light);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.refresh-btn:hover,
.refresh-btn:focus {
    background: rgba(255, 140, 0, 0.25);
    border-color: rgba(255, 140, 0, 0.6);
    transform: translateY(-1px);
}

/* ========================================
   CONTENT SECTION
   ======================================== */
section#content {
    padding: 2rem 0 3rem;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* Sıralama Butonları */
.sort-options {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.sort-btn {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-full);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(12, 12, 15, 0.9);
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sort-btn:hover,
.sort-btn:focus {
    background: rgba(255, 140, 0, 0.12);
    border-color: rgba(255, 140, 0, 0.4);
    color: var(--text-light);
    transform: translateY(-1px);
}

.sort-btn.active {
    background: rgba(255, 140, 0, 0.2);
    border-color: rgba(255, 140, 0, 0.6);
    color: var(--text-light);
}

.sort-btn[aria-pressed="true"] {
    background: rgba(255, 140, 0, 0.2);
    border-color: rgba(255, 140, 0, 0.6);
    color: var(--text-light);
}

/* ========================================
   TOST GRID VE KARTLAR
   ======================================== */
.tost-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.tost-card {
    background: rgba(13, 13, 18, 0.95);
    border-radius: var(--border-radius);
    padding: 1rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: var(--shadow-lg);
    display: flex;
    gap: 0.8rem;
    min-height: 140px;
    transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.tost-card:hover {
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

/* Oylama Bölümü */
.vote-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding-right: 0.5rem;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.vote-btn {
    width: 32px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.vote-btn:hover {
    background: rgba(255, 140, 0, 0.2);
    color: var(--primary-orange);
    transform: scale(1.05);
}

.vote-btn.upvoted {
    background: rgba(255, 140, 0, 0.25);
    color: var(--primary-orange);
    box-shadow: 0 0 10px rgba(255, 140, 0, 0.3);
}

.vote-btn.downvoted {
    background: rgba(255, 107, 107, 0.2);
    color: var(--error-light);
}

.vote-count {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-light);
    min-width: 30px;
    text-align: center;
}

/* Tost İçeriği */
.tost-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tost-text {
    font-size: 0.95rem;
    line-height: 1.5;
    flex: 1;
}

.tost-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--border-radius-sm);
    margin: 0.5rem 0;
    object-fit: cover;
}

.tost-author {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

/* ========================================
   FORM SECTION
   ======================================== */
.form-section {
    padding: 2.5rem 1.5rem 3rem;
    background: radial-gradient(circle at top, #1c1308 0, #050509 55%, #000 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

input[type="text"],
input[type="search"],
textarea {
    width: 100%;
    background: rgba(5, 5, 7, 0.9);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.7rem 0.9rem;
    color: var(--text-light);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
    resize: vertical;
    min-height: 48px;
}

textarea {
    min-height: 120px;
}

input[type="text"]:focus,
input[type="search"]:focus,
textarea:focus {
    border-color: rgba(255, 140, 0, 0.7);
    box-shadow: 0 0 0 2px rgba(255, 140, 0, 0.2);
    background: rgba(10, 10, 15, 0.95);
}

input[type="text"].error,
textarea.error {
    border-color: rgba(244, 67, 54, 0.7);
    box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.2);
}

/* Textarea Footer */
.textarea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.3rem;
}

.char-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Field Error */
.field-error {
    display: block;
    font-size: 0.8rem;
    color: var(--error-light);
    min-height: 1.2em;
    margin-top: 0.25rem;
}

/* Dosya Yükleme */
.file-upload {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius-full);
    background: rgba(5, 5, 7, 0.95);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    margin-bottom: 0.5rem;
    transition: all var(--transition-fast);
}

.file-upload:hover {
    border-color: rgba(255, 140, 0, 0.5);
    background: rgba(255, 140, 0, 0.05);
}

.file-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.image-preview {
    display: none;
    margin-top: 0.5rem;
    max-width: 200px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.image-preview.show {
    display: block;
}

.remove-image-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.8rem;
    margin-top: 0.5rem;
    border-radius: var(--border-radius-full);
    background: rgba(244, 67, 54, 0.15);
    border: 1px solid rgba(244, 67, 54, 0.4);
    color: var(--error-light);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.remove-image-btn:hover {
    background: rgba(244, 67, 54, 0.25);
}

/* Submit Butonu */
.submit-btn {
    position: relative;
    width: 100%;
    margin-top: 0.5rem;
}

.submit-btn .btn-text {
    transition: opacity var(--transition-fast);
}

.submit-btn .btn-cooldown {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
}

.submit-btn.cooling-down .btn-text {
    opacity: 0;
}

.submit-btn.cooling-down .btn-cooldown {
    opacity: 1;
}

/* Form Mesajları */
.form-messages {
    margin-top: 1rem;
}

.success-message,
.error-message {
    padding: 0.8rem 1rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity var(--transition-medium), transform var(--transition-medium);
    margin-top: 0.5rem;
}

.success-message {
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.4);
    color: var(--success-light);
}

.error-message {
    background: rgba(244, 67, 54, 0.15);
    border: 1px solid rgba(244, 67, 54, 0.4);
    color: var(--error-light);
}

.success-message.show,
.error-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   ABOUT SECTION
   ======================================== */
#about {
    padding: 2.5rem 1.5rem 3rem;
}

.about-content p {
    margin-bottom: 1rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ========================================
   FOOTER
   ======================================== */
footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: #050507;
    padding: 1.2rem 1.5rem;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--text-light);
}

.footer-links .admin-link {
    color: var(--primary-orange);
}

/* ========================================
   MOBİL STİLLER
   ======================================== */
@media (max-width: 768px) {
    /* Hamburger menü göster */
    .hamburger-btn {
        display: flex;
    }
    
    .mobile-menu-overlay {
        display: block;
    }
    
    /* Nav linklerini mobil menü olarak stillendir */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        flex-direction: column;
        background: rgba(10, 10, 15, 0.98);
        padding: 80px 2rem 2rem;
        gap: 0;
        z-index: var(--z-mobile-menu);
        transition: right var(--transition-medium);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }
    
    .nav-links a {
        display: block;
        padding: 1rem 0;
        font-size: 1rem;
    }
    
    .nav-links a::after {
        display: none;
    }
    
    .hero {
        padding-top: 3rem;
    }
    
    .tost-grid {
        grid-template-columns: 1fr;
    }
    
    .random-tost-card {
        padding: 1.5rem;
    }
    
    .random-tost-text {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .sort-options {
        gap: 0.5rem;
    }
    
    .sort-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

/* ========================================
   ANIMASYONLAR
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tost-card {
    animation: fadeIn 0.3s ease forwards;
}

/* Reduced motion tercih edenler için */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}
