/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    direction: rtl;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-content h2 {
    color: #0066cc;
    margin-bottom: 20px;
    font-size: 24px;
    text-align: right;
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover,
.close:focus {
    color: #000;
}

.form-group {
    margin-bottom: 20px;
    text-align: right;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Tajawal', sans-serif;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 5px rgba(0, 102, 204, 0.3);
}

.form-group input[readonly] {
    background-color: #e3f2fd;
    cursor: not-allowed;
    border: 2px solid #0066cc;
    font-weight: 500;
    color: #0066cc;
}

.error-message {
    color: #0066cc;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    flex-direction: row-reverse;
}

.form-actions button {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.form-actions .btn-primary {
    background-color: #0066cc;
    color: white;
}

.form-actions .btn-primary:hover {
    background-color: #0052a3;
}

.form-actions .btn-secondary {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.form-actions .btn-secondary:hover {
    background-color: #e0e0e0;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background-color: #0066cc;
    color: white;
}

.btn-primary:hover {
    background-color: #0052a3;
}

.btn-secondary {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

/* Success and Error Messages */
.success-message {
    color: #2e7d32;
    background-color: #c8e6c9;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid #2e7d32;
}

.error-message {
    color: #0066cc;
    background-color: #e3f2fd;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid #0066cc;
}

/* Responsive Design */
@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .modal-content h2 {
        font-size: 20px;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    .form-actions button {
        width: 100%;
    }
}


/* Success Modal Styles */
.success-modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    direction: rtl;
}

.success-modal.show {
    display: flex;
}

.success-modal-content {
    background-color: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 450px;
    width: 90%;
    position: relative;
    text-align: center;
    animation: slideIn 0.3s ease-out;
}

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

.success-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 32px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.success-close:hover,
.success-close:focus {
    color: #333;
}

.success-modal-body {
    text-align: center;
}

.success-icon {
    font-size: 60px;
    margin-bottom: 20px;
    display: block;
}

.success-modal-content h2 {
    color: #155724;
    margin-bottom: 15px;
    font-size: 28px;
    font-weight: 700;
}

.success-modal-content p {
    color: #333;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.success-modal-content p strong {
    color: #0066cc;
    font-weight: 600;
}

.success-thank-you {
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

.success-modal-content .btn {
    margin-top: 20px;
    padding: 14px 40px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.success-modal-content .btn:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Responsive Design for Success Modal */
@media (max-width: 600px) {
    .success-modal-content {
        width: 95%;
        padding: 30px 20px;
    }
    
    .success-modal-content h2 {
        font-size: 24px;
    }
    
    .success-modal-content p {
        font-size: 14px;
    }
    
    .success-icon {
        font-size: 50px;
    }
}


/* Article Cards Styles */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
    width: 100%;
}

.blog-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 102, 204, 0.1);
    border: 1px solid #e0e7ff;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 102, 204, 0.2);
    border-color: #0066cc;
}

.blog-card-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
}

.blog-card-image i {
    font-size: 40px;
    opacity: 0.8;
}

.blog-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-content h2 {
    color: #0066cc;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.5;
    min-height: 54px;
}

.blog-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.blog-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.blog-meta i {
    color: #0066cc;
}

.blog-content p {
    color: #555;
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 20px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #0066cc;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    padding: 10px 0;
    border-bottom: 2px solid transparent;
}

.btn-link:hover {
    color: #0052a3;
    border-bottom-color: #0066cc;
    gap: 12px;
}

.btn-link i {
    transition: transform 0.3s ease;
}

.btn-link:hover i {
    transform: translateX(-4px);
}

/* Article Detail Page Styles */
.article-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.article-header {
    margin-bottom: 40px;
    text-align: center;
}

.article-header h1 {
    color: #0066cc;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.4;
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 14px;
    color: #666;
    flex-wrap: wrap;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-meta i {
    color: #0066cc;
}

.article-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.article-body {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.article-body p {
    color: #333;
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 20px;
    text-align: justify;
}

.article-body h2 {
    color: #0066cc;
    font-size: 22px;
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 15px;
}

.article-body h3 {
    color: #0052a3;
    font-size: 18px;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 12px;
}

.article-body ul,
.article-body ol {
    margin-left: 20px;
    margin-bottom: 20px;
    color: #333;
}

.article-body li {
    margin-bottom: 10px;
    line-height: 1.8;
}

.article-body strong {
    color: #0066cc;
    font-weight: 600;
}

.article-footer {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.article-nav {
    display: flex;
    gap: 15px;
}

.article-nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background-color: #0066cc;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.article-nav a:hover {
    background-color: #0052a3;
    transform: translateX(-4px);
}

.back-to-blog {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #0066cc;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-to-blog:hover {
    color: #0052a3;
    gap: 12px;
}

/* Responsive Design for Articles */
@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .article-header h1 {
        font-size: 24px;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .article-body {
        padding: 20px;
    }
    
    .article-footer {
        flex-direction: column;
    }
    
    .article-nav {
        flex-direction: column;
        width: 100%;
    }
    
    .article-nav a {
        width: 100%;
        justify-content: center;
    }
}


/* Blog Section Styling */
.blog-section {
    padding: 60px 0;
    background-color: #f8f9fa;
}

.blog-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

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

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-card-image {
        height: 180px;
    }
    
    .blog-content h2 {
        font-size: 16px;
    }
}
