/* Import Arabic font */
@font-face {
    font-family: 'IBM Plex Sans Arabic';
    src: url('../font/IBMPlexSansArabic-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'IBM Plex Sans Arabic';
    src: url('../font/IBMPlexSansArabic-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

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

:root {
    --primary-color: #000000;
    --secondary-color: #ffffff;
    --accent-color: #333333;
    --text-color: #333333;
    --text-light: #777777;
    --transition: all 0.3s ease;
}

body {
    font-family: 'IBM Plex Sans Arabic', 'Tajawal', sans-serif;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    line-height: 1.6;
    direction: rtl;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

/* Filters */
.filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.location-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.filter-group {
    position: relative;
    min-width: 200px;
    max-width: 300px;
    width: 100%;
}

.filter-select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: white;
    font-family: 'IBM Plex Sans Arabic', 'Tajawal', sans-serif;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-left: 35px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    transition: border-color 0.3s ease;
    text-align: right;
    direction: rtl;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.project-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border 0.3s ease;
    position: relative;
    border: 2px solid transparent;
}

.project-card.highlighted {
    animation: highlightPulse 2s ease-in-out;
    border-color: #4CAF50;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
}

@keyframes highlightPulse {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 0 20px 10px rgba(76, 175, 80, 0);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

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

.project-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: #f5f5f5;
    position: relative;
}

.featured-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ffc107;
    color: #000;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    z-index: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.project-details {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-details h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;
}

.location {
    color: #666;
    font-size: 0.9rem;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.location i {
    color: #e74c3c;
}

.project-actions {
    margin-top: auto;
    display: flex;
    gap: 10px;
    padding-top: 10px;
    align-items: center;
}

.project-buttons {
    display: flex;
    gap: 1rem;
    margin-top: auto;
    flex-wrap: wrap;
}

.whatsapp-btn, .pdf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    text-align: center;
    border: none;
    cursor: pointer;
    font-family: inherit;
    min-width: 100px;
}

.whatsapp-btn {
    background: #25D366;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.whatsapp-btn:hover {
    background: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.whatsapp-btn i {
    font-size: 1.1em;
}

.pdf-btn {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.pdf-btn:hover:not(.disabled) {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.pdf-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f8f9fa;
    color: #6c757d;
}

.pdf-btn i {
    color: #dc3545;
}

/* Share button */
.share-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0f2f5;
    border: none;
    color: #4b4f56;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-right: auto;
}

.share-btn:hover {
    background: #e4e6e9;
    transform: translateY(-2px);
}

.share-btn i {
    font-size: 1rem;
}

/* Tooltip for share button */
.share-btn-tooltip {
    visibility: hidden;
    width: 100px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    right: 50%;
    transform: translateX(50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
}

.share-btn-container {
    position: relative;
    display: inline-block;
}

.share-btn-container:hover .share-btn-tooltip {
    visibility: visible;
    opacity: 1;
}

/* Share success message */
.share-success {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
    align-items: center;
    gap: 8px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Featured projects styling */
.project-card.featured {
    border: 2px solid #ffc107;
}

.project-card.featured .featured-tag {
    display: block;
}

/* Loading and Error States */
.loading, .error, .no-projects {
    text-align: center;
    padding: 2rem;
    grid-column: 1 / -1;
}

.loading {
    color: #666;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.no-projects {
    color: #666;
    font-size: 1.1rem;
}

.error {
    color: #d32f2f;
}

.error button {
    margin-top: 1rem;
    padding: 0.5rem 1.5rem;
    background: #d32f2f;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.error button:hover {
    background: #b71c1c;
}

/* Loading animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading::after {
    content: '';
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #000;
    animation: spin 1s ease-in-out infinite;
}

/* Responsive Design */
@media (max-width: 992px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .filters-container {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        padding: 0.5rem 0;
    }
    
    .filters {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.5rem;
        max-width: 100%;
        margin: 0 auto;
    }
    
    .filter-btn {
        white-space: nowrap;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        flex: 0 0 auto;
        margin: 0;
    }
    
    /* Hide scrollbar as we're now wrapping */
    .filters::-webkit-scrollbar {
        display: none;
    }
}
