/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Sade Siyah-Kırmızı Tema */
    --bg-primary: #0b0b0b;
    --bg-gradient-start: #0b0b0b;
    --bg-gradient-end: #0b0b0b;
    --bg-secondary: #151515;
    --bg-card: #1a1a1a;
    --bg-card-hover: #1f1f1f;
    --text-primary: #e6e6e6;
    --text-secondary: #a0a0a0;
    --accent-red: #d12b2b;
    --accent-red-dark: #a81f1f;
    --accent-red-light: #ff3b3b;
    --accent-purple: #7209b7;
    --accent-blue: #4895ef;
    --accent-cyan: #06ffa5;
    --border-color: #2a2a2a;
    --border-glow: rgba(209, 43, 43, 0.3);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px rgba(209, 43, 43, 0.3);
    --shadow-glow-purple: 0 0 20px rgba(114, 9, 183, 0.3);
    --shadow-glow-blue: 0 0 20px rgba(72, 149, 239, 0.3);
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

/* Site içeriğini %90 scale'e al (navbar ve footer hariç) */
body > *:not(.navbar):not(nav):not(header):not(.site-footer):not(footer):not(.hero-section):not(.error-container):not(.mobile-nav) {
    transform: scale(0.9);
    transform-origin: top center;
    width: 111.11%; /* 100% / 0.9 to compensate */
    margin: 0 auto;
}

/* Mobilde scale'ı devre dışı bırak */
@media (max-width: 768px) {
    body > *:not(.navbar):not(nav):not(header):not(.site-footer):not(footer):not(.hero-section):not(.error-container):not(.mobile-nav) {
        transform: none !important;
        width: 100% !important;
        margin: 0 !important;
    }
}

/* Container'lar için özel ayar */
.container:not(.hero-section .container):not(.error-container .container),
.topic-container,
.notifications-container,
.read-container,
.profile-container,
.write-container,
.settings-wrapper,
.support-container {
    transform: scale(0.9);
    transform-origin: top center;
    width: 111.11%;
}

/* Mobilde container scale'ını devre dışı bırak */
@media (max-width: 768px) {
    .container:not(.hero-section .container):not(.error-container .container),
    .topic-container,
    .notifications-container,
    .read-container,
    .profile-container,
    .write-container,
    .settings-wrapper,
    .support-container {
        transform: none !important;
        width: 100% !important;
    }
}

/* Hero section ve error container scale'dan muaf */
.hero-section,
.hero-section *,
.error-container,
.error-container * {
    transform: none !important;
    width: auto !important;
}

/* Footer'ı scale'dan hariç tut */
.site-footer,
footer {
    transform: none !important;
    width: 100% !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0b0b0b;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: 80px;
    display: flex;
    flex-direction: column;
}

body > main,
body > div:not(.navbar):not(nav):not(header):not(.site-footer):not(footer):not(.modal) {
    flex: 1;
}

.container {
    max-width: 90%;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Book Card Design - Wattpad Style (Dikdörtgen - Küçük Sabit Boyut) */
.book-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 280px; /* Daha küçük - orantılı */
}

.book-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--accent-red);
    box-shadow: var(--shadow-glow);
}

.book-card-image {
    width: 100%;
    height: 280px; /* Daha küçük - orantılı */
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent-red), var(--accent-red-dark));
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-card-image img {
    width: 100%;
    height: 280px; /* Daha küçük - resim zorunlu boyuta */
    object-fit: cover; /* Resmi kırp, boşluk bırakma */
    display: block;
    transition: var(--transition);
}

.book-card-image-placeholder {
    width: 100%;
    height: 280px; /* Daha küçük - orantılı */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: rgba(255,255,255,0.3);
}

/* Hover Overlay with Blur Effect */
.book-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
    padding: 1.5rem;
    text-align: center;
    z-index: 10;
}

.book-card:hover .book-card-overlay {
    opacity: 1;
}

.book-card:hover .book-card-image img {
    filter: blur(6px);
    transform: scale(1.15);
}

.book-card-title {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem; /* Küçük kartlara uygun */
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.9), 0 0 20px rgba(0,0,0,0.7);
    opacity: 0;
    transition: var(--transition);
    width: 90%;
    text-align: center;
    line-height: 1.3;
    z-index: 20;
    word-wrap: break-word;
    text-overflow: ellipsis;
}

.book-card:hover .book-card-title {
    opacity: 1;
}

.book-card-read-btn {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0.75rem 2rem;
    background: var(--accent-red);
    color: white;
    border: 2px solid var(--accent-red);
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(209, 43, 43, 0.5);
    z-index: 20;
    white-space: nowrap;
}

.book-card:hover .book-card-read-btn {
    opacity: 1;
}

.book-card-read-btn:hover {
    background: white;
    color: var(--accent-red);
    transform: translate(-50%, -50%) scale(1.08);
    box-shadow: 0 6px 24px rgba(209, 43, 43, 0.7);
}

.book-card-edit-btn {
    position: absolute;
    top: 78%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0.75rem 2rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 20;
    white-space: nowrap;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.book-card:hover .book-card-edit-btn {
    opacity: 1;
}

.book-card-edit-btn:hover {
    background: white;
    color: var(--accent-red);
    border-color: white;
    transform: translate(-50%, -50%) translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.4);
}

/* Hide default meta and footer - Completely Remove */
.book-card-meta,
.book-card-footer,
.book-card-description {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Grid Layouts - Wattpad Style (Dikdörtgen Kartlar - Küçük Sabit Boyut) */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.2rem;
}

/* Kitap kartı sabit genişlik ve yükseklik - Dikdörtgen (Küçük) */
.books-grid .book-card {
    height: 280px;
    width: 100%;
}

/* Section Styles */
.section {
    margin-bottom: 4rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
}

.section-link {
    color: var(--accent-red);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.section-link:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    transition: var(--transition);
    font-size: 0.95rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-red) 0%, var(--accent-red-dark) 100%);
    color: white;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-red-light) 0%, var(--accent-red) 100%);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.btn-ghost {
    background: transparent;
    color: var(--accent-red);
    border: 2px solid var(--accent-red);
}

.btn-ghost:hover {
    background: var(--accent-red);
    color: white;
}

/* Filter Bar */
.filter-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar input,
.filter-bar select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: var(--transition);
}

.filter-bar input:focus,
.filter-bar select:focus {
    outline: none;
    border-color: var(--accent-red);
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.filter-select {
    min-width: 150px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.8rem;
    background: rgba(209, 43, 43, 0.1);
    border: 1px solid var(--accent-red);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--accent-red);
    font-weight: 600;
    margin-bottom: 2px;
    margin-right: 2px;
    cursor: pointer;
    transition: background 0.2s;
}

.badge:hover {
    background: var(--accent-red);
    color: white;
}

#genreSuggestions .badge {
    background: rgba(209,43,43,0.07);
    border: 1px solid var(--border-color);
    color: var(--accent-red);
    margin-bottom: 2px;
    margin-right: 2px;
}

#genreSuggestions .badge:hover {
    background: var(--accent-red-light);
    color: white;
}

#genreTagsList {
    min-height: 32px;
}

#genreTagInputContainer {
    margin-bottom: 0.5rem;
}

#genreTagInput {
    padding-left: 0.7em;
    padding-right: 3.8rem; /* make room for overlay badge inside input */
}

/* wrapper position already inline; overlay badge inside input */
.genre-input-wrapper { position: relative; }
.genre-input-badge {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.06);
    color: var(--accent-red);
    border: 1px solid rgba(255,255,255,0.04);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    pointer-events: none;
    white-space: nowrap;
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE & TABLET
   ============================================ */

/* Tablet (1024px ve altı) */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Mobil Büyük (768px ve altı) */
@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .books-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-bar {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .filter-bar input,
    .filter-bar select {
        width: 100%;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    /* Navbar mobil */
    .nav-menu {
        gap: 1rem;
    }
    
    .nav-link {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
    
    .nav-icon {
        display: none;
    }
    
    /* Cards */
    .book-card,
    .forum-card {
        padding: 1.25rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.7rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* Mobil Küçük (480px ve altı) */
@media (max-width: 480px) {
    body {
        padding-top: 65px;
    }
    
    .container {
        padding: 0 0.75rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    /* Navbar çok küçük ekranlar */
    .nav-container {
        padding: 0.6rem 1rem;
        grid-template-columns: 150px 1fr 150px;
        gap: 1rem;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .nav-menu {
        gap: 0.5rem;
    }
    
    .nav-link {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    
    /* Cards çok küçük */
    .book-card,
    .forum-card {
        padding: 1rem;
    }
    
    .book-title {
        font-size: 1rem;
    }
    
    .book-author {
        font-size: 0.8rem;
    }
    
    /* Buttons küçük */
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    /* Avatar */
    .avatar {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
}

/* Mobile Responsive - Additional improvements */
@media (max-width: 768px) {
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .book-card {
        height: 240px;
    }
    
    .book-card-image,
    .book-card-image img {
        height: 240px;
    }
    
    .book-card-image-placeholder {
        height: 240px;
        font-size: 2rem;
    }
    
    .book-card-title {
        font-size: 1rem;
        padding: 0.5rem;
    }
    
    .book-card-read-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .write-container,
    .manage-container,
    .settings-container {
        padding: 1rem 0.75rem;
    }
    
    .modes-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .mode-card {
        padding: 1.5rem;
    }
    
    .language-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 60px;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.75rem;
    }
    
    .book-card {
        height: 200px;
    }
    
    .book-card-image,
    .book-card-image img,
    .book-card-image-placeholder {
        height: 200px;
    }
    
    .book-card-image-placeholder {
        font-size: 1.5rem;
    }
    
    .book-card-title {
        font-size: 0.9rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Profile Links Styles */
.profile-links-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
}

.profile-link {
    color: #4895ef;
    font-weight: 600;
    text-decoration: underline;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    transition: var(--transition);
}

.profile-link:hover {
    color: #1a73e8;
    text-decoration: underline;
    opacity: 0.8;
}

.profile-link-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.profile-link-url,
.profile-link-text {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
}

.profile-link-url:focus,
.profile-link-text:focus {
    outline: none;
    border-color: var(--accent-red);
}

.btn-remove-link {
    padding: 0.7rem 1rem;
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid #f44336;
    color: #f44336;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-remove-link:hover {
    background: #f44336;
    color: white;
}

.profile-bio {
            color: var(--text-secondary);
            line-height: 1.7;
            margin-bottom: 0.5rem;
            font-size: 1.05rem;
            max-height: 180px;
            overflow-y: auto;
            word-break: break-word;
            white-space: pre-line;
            background: var(--bg-secondary);
            border-radius: 8px;
            padding: 1rem;
            box-sizing: border-box;
        }

