/* الأساسيات */
:root {
    --primary: #209fe5;
    --secondary: #edc315;
    --accent: #edc315;
    --light: #f8f9fa;
    --dark: #212529;
    --text: #333;
    --gray: #6c757d;
    --success: #28a745;
}

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

body {
    font-family: 'Tajawal', sans-serif;
    background-color: #f5f7fa;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* الهيدر */
.main-header {
    background: linear-gradient(135deg, var(--primary) 50%, var(--dark) 100%);
    color: white;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-content {
    max-width: 1000px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    height: 60px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    transition: all 0.3s ease;
}

.logo:hover {
    filter: brightness(0) invert(0.9) drop-shadow(0 0 5px var(--secondary));
}

.title-container {
    text-align: right;
    flex-grow: 1;
}

.title-container h1 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.title-container p {
    margin: 5px 0 0;
    font-size: 0.85rem;
    opacity: 0.9;
    color: rgba(255,255,255,0.9);
}

/* المحتوى الرئيسي */
.main-content {
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.container {
    width: 100%;
}

/* بطاقات العرض */
.cards-view {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-right: 4px solid var(--secondary);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #eee;
}

.card-title {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
    margin: 0;
}

.card-date {
    background-color: var(--light);
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8rem;
    color: var(--dark);
}

.card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.card-item {
    display: flex;
    gap: 5px;
}

.card-icon {
    color: var(--secondary);
    width: 20px;
    text-align: center;
}

.card-label {
    font-weight: 500;
    color: var(--dark);
    font-size: 0.9rem;
}

.card-value {
    color: var(--text);
    font-size: 0.9rem;
}

/* زر التحديث العائم */
.floating-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 999;
}

.card-link {
    color: var(--primary);
    text-decoration: none;
    word-break: break-all;
    transition: all 0.3s ease;
    border-bottom: 1px dashed currentColor;
}

.card-link:hover {
    color: var(--accent);
    border-bottom-style: solid;
}


/* تصميم عداد الأنشطة */
.activities-count {
    margin: 5px 0 0;
    font-size: 0.9rem;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.9);
    background-color: rgba(255, 255, 255, 0.1);
    padding: 5px 10px;
    border-radius: 15px;
    display: inline-block;
}

.activities-count strong {
    color: var(--secondary);
    font-weight: 700;
}

/* للتجاوب مع الجوال */
@media (max-width: 768px) {
    .activities-count {
        font-size: 0.8rem;
        padding: 3px 8px;
    }
}
/* زر الأرشيف */
.archive-toggle {
    text-align: center;
    margin: 15px 0;
}

.archive-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.archive-btn:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

.archive-btn.active {
    background-color: var(--accent);
}

.archive-btn.active:hover {
    background-color: #d4ac0d;
}


/* أنماط التقويم */
.calendar-toggle {
    text-align: center;
    margin: 20px 0;
}

#toggle-calendar {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#toggle-calendar:hover {
    background-color: var(--dark);
    transform: translateY(-2px);
}

.calendar-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 10px;
}

.calendar-header h3 {
    margin: 0;
    color: var(--primary);
    font-size: 1.2rem;
}

.calendar-header button {
    background: var(--light);
    border: none;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.calendar-header button:hover {
    background: var(--secondary);
    color: white;
}

.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    text-align: center;
}

.calendar-day {
    padding: 12px 5px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 45px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
}

.calendar-day.header {
    font-weight: bold;
    background-color: var(--primary);
    color: white;
    cursor: default;
    padding: 10px 5px;
    font-size: 0.9rem;
}

.calendar-day.empty {
    background-color: #f8f9fa;
    cursor: default;
    border: none;
}

.calendar-day.has-events {
    background-color: rgba(237, 195, 21, 0.15);
    border-color: var(--secondary);
    font-weight: bold;
    color: var(--dark);
}

.calendar-day.has-events:hover {
    background-color: var(--secondary);
    color: white;
    transform: scale(1.05);
}

/* نقاط وأرقام الأحداث */
.event-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    background-color: var(--accent);
    border-radius: 50%;
}

.event-count {
    position: absolute;
    top: 3px;
    left: 3px;
    background-color: var(--accent);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* عنوان التاريخ المحدد */
.selected-date-header {
    background: linear-gradient(135deg, var(--primary), var(--dark));
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.selected-date-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.back-button {
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.back-button:hover {
    background-color: var(--primary);
}

.hidden {
    display: none;
}
/* لضبط الروابط الطويلة */
.card-value a {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.header-icons {
    display: flex;
    gap: 15px;
    margin-right: 20px;
}

.header-icon {
    color: white;
    font-size: 1.3rem;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
}

.header-icon:hover {
    color: var(--accent); /* اللون الذهبي (#edc315) */
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* للتجاوب مع الجوال */
@media (max-width: 768px) {
    .header-icons {
        margin-right: 0;
        gap: 10px;
    }
    
    .header-icon {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
    }
}
#refresh-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--accent);
    color: white;
    border: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#refresh-btn:hover {
    transform: scale(1.1) rotate(90deg);
}

#refresh-btn.loading {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* تأثيرات التحميل */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    grid-column: 1 / -1;
}

.spinner {
    border: 4px solid rgba(0,0,0,0.1);
    border-top: 4px solid var(--secondary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

/* رسائل الخطأ */
.error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    color: var(--accent);
}

/* التكيف مع الشاشات الكبيرة */
@media (min-width: 768px) {
    .cards-view {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-content {
        padding: 0 20px;
    }
    
    .main-content {
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .logo {
        height: 50px;
        max-width: 180px;
    }
    
    .title-container {
        text-align: center;
    }
    
    .title-container h1 {
        font-size: 1.1rem;
    }
    
    .title-container p {
        font-size: 0.75rem;
    }
}