/*
 * Hebrew Short Stories Website - Professional CSS
 * Optimized for both desktop and mobile devices
 */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --text-color: #333;
    --bg-color: #ffffff;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Assistant', 'Heebo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.8;
    font-size: 18px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Heebo', 'Assistant', sans-serif;
    font-weight: 700;
    line-height: 1.4;
    color: var(--dark-color);
}

.display-4 {
    font-size: 3rem;
    font-weight: 700;
}

@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    .display-4 {
        font-size: 2rem;
    }
}

/* Navigation */
.navbar {
    box-shadow: var(--shadow);
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-icon {
    font-size: 1.8rem;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 300px);
    padding: 2rem 0;
}

/* Homepage Hero */
.homepage-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    margin-bottom: 2rem;
}

.homepage-hero h1,
.homepage-hero p {
    color: white;
}

/* Section Titles */
.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.section-title .icon {
    font-size: 2rem;
}

/* Popular Stories */
.popular-stories-list {
    background: var(--light-color);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.popular-story-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 8px;
    transition: var(--transition);
}

.popular-story-item:hover {
    transform: translateX(-5px);
    box-shadow: var(--shadow);
}

.popular-story-item:last-child {
    margin-bottom: 0;
}

.story-rank {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 40px;
    text-align: center;
}

.story-title {
    flex: 1;
    font-weight: 500;
}

.story-views {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* Story Cards */
.story-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.story-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.story-card-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--light-color);
}

.story-card .story-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.story-author {
    color: var(--secondary-color);
    font-size: 0.95rem;
    margin: 0;
}

.story-card-body {
    padding: 1.5rem;
    flex: 1;
}

.story-preview {
    color: var(--text-color);
    line-height: 1.7;
    margin: 0;
}

.story-card-footer {
    padding: 1rem 1.5rem;
    background: var(--light-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.story-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.view-count {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.btn-read {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
}

/* Story Page */
.story-page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.story-meta-info {
    display: flex;
    gap: 2rem;
    color: var(--secondary-color);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-color);
}

.story-meta-info span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.author-info,
.view-info {
    font-size: 1rem;
}

.story-content {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    font-size: 1.15rem;
    line-height: 2;
    color: var(--text-color);
}

.story-content p {
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .story-page-title {
        font-size: 1.8rem;
    }

    .story-content {
        padding: 1.5rem;
        font-size: 1.05rem;
        line-height: 1.9;
    }

    .story-meta-info {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Empty State */
.empty-state {
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 80px;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Ads */
.ad-container {
    margin: 1.5rem 0;
    text-align: center;
}

.ad-placeholder {
    background: var(--light-color);
    padding: 2rem;
    border-radius: 8px;
    color: var(--secondary-color);
    font-size: 0.9rem;
    border: 2px dashed var(--secondary-color);
}

.ad-top-banner,
.ad-bottom-banner {
    margin: 1rem 0;
}

.ad-story-top,
.ad-story-bottom {
    max-width: 728px;
    margin: 1.5rem auto;
}

.ad-sidebar {
    position: fixed;
    left: 2rem;
    top: 120px;
    width: 300px;
}

.ad-sticky {
    position: sticky;
    top: 100px;
}

@media (max-width: 1400px) {
    .ad-sidebar {
        display: none !important;
    }
}

/* Footer */
.footer {
    margin-top: auto;
    background: var(--light-color);
    border-top: 1px solid #dee2e6;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
}

.breadcrumb-item a {
    text-decoration: none;
    color: var(--primary-color);
}

/* Buttons */
.btn {
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-color);
    border: none;
}

.btn-primary:hover {
    background: #0b5ed7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.btn-outline-primary:hover {
    transform: translateY(-2px);
}

/* Error Page */
.error-page {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.error-icon {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Responsive Grid */
@media (max-width: 576px) {
    .story-card-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .btn-read {
        width: 100%;
        justify-content: center;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: var(--primary-color);
    color: white;
}

/* Focus Styles */
a:focus,
button:focus,
.btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

