/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    direction: rtl;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo h1 a {
    color: white;
    text-decoration: none;
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.search-box {
    display: flex;
    background: white;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-width: 300px;
}

.search-box input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    outline: none;
    font-size: 14px;
    color: #333;
}

.search-box button {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.search-box button:hover {
    background: #ff5252;
}

.nav-menu ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: #ffd700;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 3rem 0;
    background: white;
    border-radius: 15px;
    margin-bottom: 3rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.hero-section h2 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-section p {
    font-size: 1.2rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* Apps Grid */
.apps-grid {
    margin-bottom: 3rem;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.app-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.app-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #999;
    position: relative;
    overflow: hidden;
}

.app-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-content {
    padding: 1.5rem;
}

.app-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.app-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.download-btn {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-size: 1rem;
}

.download-btn:hover {
    background: linear-gradient(135deg, #ff5252, #ff7979);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

/* Load More Button */
.load-more-section {
    text-align: center;
    margin: 3rem 0;
}

.load-more-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: #ffd700;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #ffd700;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    background: #34495e;
    padding: 10px 15px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.social-link:hover {
    background: #4a6741;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #34495e;
    color: #bdc3c7;
}

/* Article Page Styles */
.article-header {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.article-image {
    width: 200px;
    height: 200px;
    margin: 0 auto 1.5rem;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-title {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 1rem;
    font-weight: 700;
}

.article-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    line-height: 1.8;
}

.article-content h2 {
    color: #333;
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #ff6b6b;
}

.article-content h3 {
    color: #555;
    font-size: 1.4rem;
    margin: 1.5rem 0 0.8rem;
}

.article-content p {
    margin-bottom: 1rem;
    color: #666;
}

.article-content ul,
.article-content ol {
    margin: 1rem 0 1rem 2rem;
    color: #666;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.download-section {
    text-align: center;
    margin: 3rem 0;
}

.main-download-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 20px 50px;
    border-radius: 30px;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.main-download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(40, 167, 69, 0.4);
}

/* Related Articles */
.related-articles {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.related-articles h3 {
    color: #333;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.related-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 10px;
    transition: background 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.related-item:hover {
    background: #f8f9fa;
}

.related-image {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    background: #f0f0f0;
    flex-shrink: 0;
    overflow: hidden;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-content h4 {
    color: #333;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.related-content p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Comments Section */
.comments-section {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.comments-section h3 {
    color: #333;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.comment {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 1rem;
}

.comment:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.comment-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
}

.comment-info h4 {
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.comment-date {
    color: #999;
    font-size: 0.9rem;
}

.comment-text {
    color: #666;
    line-height: 1.6;
}

/* Download Page Styles */
.download-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem 0;
}

.download-container {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
    max-width: 500px;
    width: 100%;
    position: relative;
}

/* Back Button Styles */
.back-button-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.back-button {
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 25px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    color: #667eea;
    backdrop-filter: blur(10px);
    font-size: 0.9rem;
}

.back-button:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.back-button:active {
    transform: translateY(0);
}

.back-icon {
    font-size: 1.1rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.back-button:hover .back-icon {
    transform: translateX(-3px);
}

.back-text {
    font-size: 0.85rem;
}

.download-app-image {
    width: 150px;
    height: 150px;
    margin: 0 auto 1.5rem;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.download-app-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.download-app-title {
    font-size: 2rem;
    color: #333;
    margin-bottom: 2rem;
    font-weight: 700;
}

.timer-section {
    margin: 2rem 0;
}

.timer-text {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 1rem;
}

.timer-display {
    font-size: 3rem;
    font-weight: 700;
    color: #ff6b6b;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.timer-progress {
    width: 200px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    margin: 1rem auto;
    overflow: hidden;
}

.timer-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #ff8e8e);
    border-radius: 10px;
    width: 100%;
    transition: width 1s linear;
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.3);
}

.final-download-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
}

.final-download-btn.show {
    opacity: 1;
    transform: translateY(0);
}

.final-download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(40, 167, 69, 0.4);
}

/* Animation for download button */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

/* Shake animation for page */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    /* Back button responsive */
    .back-button-container {
        top: 15px;
        right: 15px;
    }
    
    .back-button {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .back-icon {
        font-size: 1rem;
    }
    
    .back-text {
        font-size: 0.8rem;
    }
    
    .search-box {
        min-width: 250px;
        width: 100%;
    }
    
    .nav-menu ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .hero-section h2 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .grid-container {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .article-title {
        font-size: 2rem;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .download-container {
        margin: 1rem;
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-section {
        padding: 2rem 1rem;
    }
    
    .app-content {
        padding: 1rem;
    }
    
    .article-content {
        padding: 1.5rem;
    }
    
    .download-container {
        padding: 1.5rem;
    }
    
    .timer-display {
        font-size: 2.5rem;
    }
}