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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    padding: 20px;
    min-height: 100vh;
    color: #333;
}

.page {
    max-width: 1400px;
    margin: 0 auto;
}

.page__head {
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.back-btn {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    margin-bottom: 20px;
    font-size: 16px;
    transition: 0.3s;
}

.back-btn:hover {
    background: #1a2a3a;
}

.toolbar {
    background: rgba(255,255,255,0.9);
    border-radius: 15px;
    padding: 15px 20px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.tool-btn {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: 0.3s;
}

.tool-btn:hover {
    background: #1a2a3a;
}

.loader {
    font-weight: bold;
    color: #2c3e50;
}

/* Grid & List Layouts */
.projects-container.grid-view .projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.projects-container.list-view .projects-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Project Card Styles (Text Only) */
.project-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    border-right: 5px solid #2c3e50; /* شريط جمالي جانبي */
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    background-color: #f9f9f9;
}

.project-info h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #1e3c72;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.project-info p {
    margin: 8px 0;
    color: #555;
    font-size: 15px;
    line-height: 1.6;
}

.project-info strong {
    color: #2c3e50;
    display: inline-block;
    width: 140px; /* محاذاة العناوين */
}

/* List View Specifics */
.list-view .project-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.list-view .project-info {
    width: 100%;
}

.list-view .project-info h3 {
    border-bottom: none;
    margin-bottom: 5px;
}

.list-view .project-info p {
    display: inline-block;
    margin-left: 15px;
    margin-right: 15px;
}

/* Modal Styles (للنافذة المنبثقة) */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.7); 
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto; 
    padding: 30px;
    border-radius: 15px;
    width: 80%; 
    max-width: 700px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
    position: relative;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {opacity: 0; transform: translateY(-20px);}
    to {opacity: 1; transform: translateY(0);}
}

.close-modal {
    color: #aaa;
    float: left; /* لأن الاتجاه RTL */
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.close-modal:hover,
.close-modal:focus {
    color: #000;
    text-decoration: none;
}

#modalTitle {
    color: #1e3c72;
    margin-bottom: 20px;
    font-size: 24px;
}

#modalBody p {
    margin-bottom: 10px;
    font-size: 16px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 5px;
}

#modalBody strong {
    color: #2c3e50;
}

footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    padding: 20px;
}

@media (max-width: 768px) {
    .projects-container.grid-view .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .list-view .project-card {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .list-view .project-info p {
        display: block;
        margin: 5px 0;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .modal-content {
        width: 95%;
        margin: 20% auto;
    }
}