/*
Theme Name: RealForyou Theme
*/

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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --dark: #0f172a;
    --dark-card: #1e293b;
    --light: #f8fafc;
    --white: #ffffff;
    --gray: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
    --radius: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--light);
    color: var(--dark);
    transition: var(--transition);
    line-height: 1.7;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

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

/* ===== HEADER ===== */
.site-header {
    background: var(--white);
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 28px;
    font-weight: 800;
    color: var(--dark);
}

.logo span {
    color: var(--primary);
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.main-nav ul li a {
    color: var(--dark);
    font-weight: 500;
    font-size: 15px;
}

.main-nav ul li a:hover {
    color: var(--primary);
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.header-actions button {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--dark);
    transition: var(--transition);
}

.header-actions button:hover {
    color: var(--primary);
}

/* ===== SEARCH OVERLAY ===== */
.search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.search-overlay.active {
    display: flex;
}

.search-modal {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    position: relative;
}

.search-modal .close-search {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray);
}

.search-modal h3 {
    margin-bottom: 20px;
}

.search-modal form {
    display: flex;
    gap: 10px;
}

.search-modal input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
}

.search-modal input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-modal button {
    padding: 12px 25px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

/* ===== SECTION TITLES ===== */
.section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 25px;
}

.section-title span {
    color: var(--primary);
}

/* ===== FEATURED SECTION ===== */
.featured-section {
    padding: 40px 0 30px;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.featured-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.featured-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.featured-image {
    height: 220px;
    background-size: cover;
    background-position: center;
}

.featured-content {
    padding: 20px;
}

.featured-content .post-category {
    display: inline-block;
    padding: 3px 12px;
    background: var(--primary);
    color: white;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 10px;
}

.featured-content h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.featured-content h3 a {
    color: var(--dark);
}

.featured-content h3 a:hover {
    color: var(--primary);
}

.featured-content p {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 10px;
}

.post-date {
    font-size: 13px;
    color: var(--gray);
}

/* ===== TRENDING SECTION ===== */
.trending-section {
    padding: 30px 0;
    background: var(--white);
}

.trending-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.view-all {
    font-weight: 500;
    color: var(--primary);
}

.trending-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.trending-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    padding: 15px;
    background: var(--light);
    border-radius: var(--radius);
    transition: var(--transition);
}

.trending-item:hover {
    background: var(--white);
    box-shadow: var(--shadow);
}

.trending-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    opacity: 0.5;
    line-height: 1;
}

.trending-content h4 {
    font-size: 16px;
    margin-bottom: 5px;
}

.trending-content h4 a {
    color: var(--dark);
}

.trending-content h4 a:hover {
    color: var(--primary);
}

/* ===== CATEGORY SECTIONS ===== */
.category-section {
    padding: 40px 0;
}

.category-section.alt-bg {
    background: var(--white);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.post-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.post-image {
    height: 180px;
    background-size: cover;
    background-position: center;
}

.post-content {
    padding: 18px;
}

.post-content h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.post-content h3 a {
    color: var(--dark);
}

.post-content h3 a:hover {
    color: var(--primary);
}

.post-content p {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 10px;
}

/* ===== FOOTER ===== */
.site-footer {
    background: var(--dark);
    color: var(--white);
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-logo a {
    font-size: 24px;
    font-weight: 800;
    color: var(--white);
}

.footer-logo span {
    color: var(--primary);
}

.footer-logo p {
    color: #94a3b8;
    margin-top: 10px;
}

.footer-menu ul {
    list-style: none;
}

.footer-menu ul li {
    margin-bottom: 10px;
}

.footer-menu ul li a {
    color: #94a3b8;
}

.footer-menu ul li a:hover {
    color: var(--white);
}

.footer-social {
    display: flex;
    gap: 15px;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: var(--white);
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

/* ===== BACK TO TOP ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(99,102,241,0.4);
    transition: var(--transition);
    opacity: 0;
    visibility: hidden;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-3px);
    background: var(--primary-dark);
}

/* ===== DARK MODE ===== */
body.dark-mode {
    background: var(--dark);
    color: var(--light);
}

body.dark-mode .site-header {
    background: var(--dark-card);
}

body.dark-mode .logo a {
    color: var(--white);
}

body.dark-mode .main-nav ul li a {
    color: var(--light);
}

body.dark-mode .main-nav ul li a:hover {
    color: var(--primary);
}

body.dark-mode .header-actions button {
    color: var(--light);
}

body.dark-mode .featured-card {
    background: var(--dark-card);
}

body.dark-mode .featured-content h3 a {
    color: var(--white);
}

body.dark-mode .trending-section {
    background: var(--dark-card);
}

body.dark-mode .trending-item {
    background: var(--dark);
}

body.dark-mode .trending-content h4 a {
    color: var(--white);
}

body.dark-mode .post-card {
    background: var(--dark-card);
}

body.dark-mode .post-card h3 a {
    color: var(--white);
}

body.dark-mode .category-section.alt-bg {
    background: var(--dark-card);
}

body.dark-mode .search-modal {
    background: var(--dark-card);
}

body.dark-mode .search-modal input {
    background: var(--dark);
    color: var(--white);
    border-color: #374151;
}

body.dark-mode .section-title {
    color: var(--white);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .featured-grid,
    .trending-grid,
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
    }
    
    .main-nav.active {
        display: block;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 20px;
        box-shadow: var(--shadow);
    }
    
    .main-nav.active ul {
        flex-direction: column;
        gap: 15px;
    }
    
    .featured-grid,
    .trending-grid,
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-wrapper {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .featured-image {
        height: 180px;
    }
    
    .section-title {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .logo a {
        font-size: 22px;
    }
    
    .featured-content h3 {
        font-size: 16px;
    }
    
    .post-content h3 {
        font-size: 15px;
    }
    
    .search-modal {
        padding: 25px;
    }
}