:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #333;
    --light-text: #f8f9fa;
    --bg-color: #f8f9fa;
    --card-bg: #fff;
    --header-bg: #2c3e50;
    --footer-bg: #2c3e50;
    --footer-text: #f8f9fa;
    --border-color: #e0e0e0;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --error-color: #e74c3c;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --text-color: #f8f9fa;
    --light-text: #f8f9fa;
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --header-bg: #121212;
    --footer-bg: #121212;
    --footer-text: #f8f9fa;
    --border-color: #333;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: var(--transition);
    line-height: 1.6;
}

header {
    background-color: var(--header-bg);
    color: var(--light-text);
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    font-size: 2rem;
    color: var(--accent-color);
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.theme-toggle {
    background-color: var(--accent-color);
    color: var(--light-text);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.theme-toggle:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Hero Section */
.hero {
    position: relative;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--light-text);
    overflow: hidden;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-description {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 2rem;
    opacity: 0.9;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 2px, transparent 2px);
    background-size: 30px 30px;
    opacity: 0.3;
    z-index: 1;
}

/* Sections */
section {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.section-header h3 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
}

.section-actions {
    display: flex;
    gap: 1rem;
}

/* Filters */
.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.filter-group {
    margin-bottom: 1rem;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.styled-select {
    width: 100%;
    padding: 0.75rem;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
    transition: var(--transition);
}

.styled-select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.filter-button {
    background-color: var(--secondary-color);
    color: var(--light-text);
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.filter-button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.results-count {
    background-color: var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.project-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-card h3 {
    margin: 0 0 1rem;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.project-card p {
    color: var(--text-color);
    margin-bottom: 1rem;
    flex: 1;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.project-meta span {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--secondary-color);
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Project Details */
.project-details {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    padding: 2rem;
    overflow-y: auto;
}

.details-content {
    background-color: var(--card-bg);
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.close-details {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-color);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.close-details:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.details-content h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.details-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

/* File Previews */
.file-preview, .video-preview {
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.03);
}

.file-preview img {
    max-width: 100%;
    max-height: 400px;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.file-preview iframe {
    width: 100%;
    height: 500px;
    border: none;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.video-preview iframe, .video-preview video {
    width: 100%;
    height: 400px;
    border-radius: 4px;
}

.download-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.download-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Add Project Section */
.add-project-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    text-align: center;
    padding: 2rem;
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.benefits-list {
    list-style: none;
    text-align: right;
    margin: 1.5rem 0;
}

.benefits-list li {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.benefits-list i {
    color: var(--success-color);
}

/* Buttons */
.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.explore-btn {
    background-color: var(--light-text);
    color: var(--primary-color);
}

.add-btn {
    background-color: var(--accent-color);
    color: var(--light-text);
}

.submit-btn {
    background-color: var(--success-color);
    color: var(--light-text);
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Footer */
footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 3rem 2rem 1rem;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-logo i {
    color: var(--accent-color);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-links a {
    color: var(--footer-text);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.social-links {
    display: flex;
    gap: 1rem;
    font-size: 1.5rem;
}

.social-links a {
    color: var(--footer-text);
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--accent-color);
    transform: translateY(-3px);
}

.copyright {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    color: var(--primary-color);
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loading::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--error-color);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    margin: 2rem 0;
    grid-column: 1 / -1;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.error button {
    background-color: var(--error-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    margin-top: 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.error button:hover {
    background-color: #c0392b;
}

.no-projects {
    text-align: center;
    padding: 3rem;
    font-size: 1.1rem;
    color: var(--text-color);
    grid-column: 1 / -1;
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

/* أنماط النافذة المنبثقة */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow: auto;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 800px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-color);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.close-modal:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.modal-body {
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px 0;
}

.modal-body h4 {
    color: var(--primary-color);
    margin: 1.5rem 0 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-body ul, .modal-body ol {
    padding-right: 1.5rem;
    margin: 1rem 0;
}

.modal-body li {
    margin-bottom: 0.5rem;
}

.modal-footer {
    text-align: left;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    margin-top: 15px;
}

.modal-button {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
}

.accept-btn {
    background-color: var(--secondary-color);
    color: white;
}

.accept-btn:hover {
    background-color: #2980b9;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-links {
        align-items: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
    }
}

[dir="rtl"] {
    text-align: right;
}