/* ===========================
   Custom Styles for Fawazeer Website
   Optimized CSS - Separated from HTML
=========================== */

/* Games Section */
.custom-games-section {
    padding: 40px 20px;
    background-color: #f8f9fa;
    direction: rtl;
    text-align: right;
}

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

.custom-section-title {
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
    color: #333;
}

.custom-game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.custom-game-box {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 16px;
    padding: 20px;
    text-decoration: none;
    color: #333;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.custom-game-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.custom-game-icon {
    font-size: 50px;
    color: #007bff;
    margin-bottom: 15px;
    display: block;
}

.custom-game-box h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #007bff;
}

.custom-game-box p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
}

/* Font Face with font-display for better CLS */
@font-face {
    font-family: 'Cairo';
    font-display: swap;
    src: local('Cairo');
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: #f0f2f5;
}

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

/* Update Badge */
.update-badge-top {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Search Section */
.search-section {
    background: linear-gradient(45deg, #3498db, #2980b9);
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.search-title {
    color: white;
    margin-bottom: 25px;
    font-size: 2em;
    font-weight: bold;
}

.search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    outline: none;
    font-size: 1.1em;
    color: #2c3e50;
}

.search-button {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 15px 30px;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: bold;
}

.search-button:hover {
    background: #34495e;
}

/* Search Results */
.search-results {
    margin-top: 30px;
    display: none;
}

.search-results.active {
    display: block;
}

.result-item {
    background: white;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    border-right: 4px solid #3498db;
}

.result-item:hover {
    transform: translateX(5px);
}

.result-title {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.2em;
    font-weight: bold;
}

.result-category {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 5px 12px;
    border-radius: 3px;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.result-content {
    color: #666;
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.9em;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    background: #2c3e50;
    color: white;
    padding: 8px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9em;
    transition: background 0.3s;
    font-weight: bold;
}

.btn-primary:hover {
    background: #34495e;
}

.no-results {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 5px;
    color: #666;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Header & Basic Elements */
header {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.riddle-container {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.riddle {
    margin-bottom: 15px;
}

.answer {
    color: #666;
    display: none;
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

button {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

button:hover {
    background-color: #c0392b;
}

.home-button {
    display: inline-block;
    margin: 20px;
    padding: 10px 20px;
    background-color: #2c3e50;
    color: white;
    text-decoration: none;
    border-radius: 5px;
}

.hero {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.fade-in {
    animation: fadeIn 2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.card {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.riddle-card {
    margin-bottom: 20px;
}

.btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

.social-links {
    margin-top: 20px;
    text-align: center;
}

.social-icon {
    margin: 0 10px;
    font-size: 24px;
    color: #666;
    transition: color 0.2s ease;
}

.social-icon:hover {
    color: #e74c3c;
}

.section-title {
    font-size: 24px;
    margin-bottom: 30px;
    color: #f1c40f;
    text-align: center;
}

/* Play Section */
.play-section {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(45deg, #2ecc71, #27ae60);
    border-radius: 10px;
    margin: 40px 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.play-title {
    color: white;
    font-size: 2.2em;
    margin-bottom: 20px;
    font-weight: bold;
}

.play-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1em;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.play-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: white;
    color: #000;
    padding: 15px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1.2em;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    margin: 10px;
}

.play-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    background: transparent;
    color: white;
    border-color: white;
}

.play-button i {
    font-size: 1.2em;
}

/* About Section */
.about-section {
    background-color: #f8f9fa;
    padding: 40px 20px;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.about-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.about-text {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.2em;
    line-height: 1.8;
}

.about-text p {
    margin-bottom: 20px;
    font-size: 18px;
}

.about-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.feature {
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    margin: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
    min-width: 250px;
    transition: transform 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
}

.feature i {
    font-size: 40px;
    margin-bottom: 15px;
    color: #007bff;
}

.feature h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
}

.feature p {
    font-size: 18px;
    color: #666;
    line-height: 1.6;
}

/* Riddles Section */
.riddles-section {
    padding: 40px 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.riddles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

.riddle-card {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.riddle-card:hover {
    transform: translateY(-5px);
}

.riddle-question {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.6;
}

.riddle-answer {
    display: none;
    font-size: 18px;
    color: #007bff !important;
    margin-top: 10px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.riddle-answer.show {
    display: block;
    opacity: 1;
}

.show-answer-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.show-answer-btn:hover {
    background-color: #0056b3;
}

/* Funny Riddles Section */
.funny-riddles-section {
    background-color: #3f3d56;
    padding: 40px 20px;
    margin-top: -30px;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.funny-riddles-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.funny-riddles-content p {
    font-size: 18px;
    line-height: 1.8;
    color: #ffffff;
    margin-bottom: 20px;
    text-align: justify;
}

.funny-riddles-content h2,
.funny-riddles-content h3 {
    color: #ff6b6b;
    margin-bottom: 25px;
    font-size: 2em;
}

/* Kids Riddles Section */
.kids-riddles-section {
    padding: 40px 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.kids-riddles-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.kids-riddles-content h2 {
    color: #ff6b6b;
    margin-bottom: 25px;
    font-size: 2em;
}

.kids-riddles-content .intro-text {
    font-size: 18px;
    line-height: 1.8;
    color: #333;
    margin-bottom: 20px;
    text-align: justify;
}

/* Hard Riddles Section */
.hard-riddles-section {
    padding: 40px 20px;
    background-color: #2c3e50;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
    color: #fff;
}

.hard-riddles-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hard-riddles-content h2 {
    color: #e74c3c;
    margin-bottom: 25px;
    font-size: 2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hard-riddles-content .intro-text {
    font-size: 18px;
    line-height: 1.8;
    margin-bottom: 30px;
    text-align: justify;
    color: #ecf0f1;
}

.hard-riddles-content .riddle-card {
    background-color: #34495e;
    border: 1px solid #455d7a;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hard-riddles-content .riddle-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.hard-riddles-content .show-answer-btn {
    background-color: #e74c3c;
}

.hard-riddles-content .show-answer-btn:hover {
    background-color: #c0392b;
}

.hard-riddles-content .riddle-answer {
    color: #2ecc71 !important;
}

/* Puzzle Intro Section */
.puzzle-intro {
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    border-radius: 20px;
    padding: 2.5rem;
    margin: 3rem auto;
    max-width: 1000px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(224, 159, 62, 0.2);
}

.puzzle-intro::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, #e09f3e, #f1c40f);
    border-radius: 5px;
}

.puzzle-content {
    position: relative;
    z-index: 1;
}

.puzzle-title {
    color: #3f3d56;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: right;
    line-height: 1.4;
    position: relative;
    padding-bottom: 15px;
}

.puzzle-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100px;
    height: 3px;
    background: linear-gradient(to right, #e09f3e, transparent);
}

.puzzle-description p {
    color: #4a4a4a;
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: justify;
    margin: 0;
    padding-right: 1rem;
    font-weight: 400;
}

.puzzle-intro:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
}

.puzzle-intro::after {
    content: '🎯';
    position: absolute;
    left: 20px;
    top: 20px;
    font-size: 1.5rem;
    opacity: 0.1;
    transform: rotate(-15deg);
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease-in-out;
    z-index: 999;
}

#back-to-top:hover {
    background-color: #2c81ba;
    transform: scale(1.1);
}

#back-to-top:active {
    background-color: #1a5e88;
}

/* Quick Links Section */
.quick-links-section {
    margin: 40px 0;
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.section-heading {
    text-align: center;
    font-size: 28px;
    margin-bottom: 30px;
    color: #2c3e50;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.quick-link-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px 20px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    color: white;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.quick-link-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.quick-link-card .icon {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
}

.quick-link-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: white;
}

.quick-link-card p {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 15px;
}

.quick-link-card .badge {
    background: rgba(255,255,255,0.3);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    display: inline-block;
}

.quick-link-card:nth-child(1) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.quick-link-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.quick-link-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.quick-link-card:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

/* Promo Banner */
.promo-banner {
    background: linear-gradient(90deg, #1877F2, #25D366, #FFD700);
    color: #000;
    padding: 20px;
    text-align: center;
    font-family: Arial, sans-serif;
    margin: 20px auto;
    border-radius: 12px;
    max-width: 720px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.promo-content h2 {
    margin: 0 0 10px;
    font-size: 24px;
    color: #fff;
}

.promo-content p {
    margin: 5px 0;
    font-size: 18px;
    color: #fff;
}

.cta-button {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    font-size: 18px;
    background-color: #FF0000;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.3s;
}

.cta-button:hover {
    background-color: #cc0000;
}

/* Responsive Design */
@media (max-width: 768px) {
    .puzzle-intro {
        padding: 1.5rem;
        margin: 1.5rem;
    }

    .puzzle-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .puzzle-description p {
        font-size: 1rem;
        line-height: 1.6;
        padding-right: 0.5rem;
    }

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

@media (max-width: 480px) {
    img {
        width: 100%;
        height: auto;
    }
}
