/**
 * Schemes Modal Styles
 * Styling for योजना (schemes) modal functionality
 */

/* ========================================
   Loading, Error, and Empty States
======================================== */

.loading-state,
.error-state,
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
}

.loading-state p,
.error-state p,
.empty-state p {
    font-size: 1rem;
    margin-top: 1rem;
    color: #5d4037;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.25rem;
}

/* ========================================
   Category Cards
======================================== */

.scheme-category-card {
    background: #fff;
    border: 2px solid #ffe0b2;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.scheme-category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #e65100, #ff9800);
    transition: height 0.3s ease;
}

.scheme-category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(230, 81, 0, 0.15);
    border-color: #ff9800;
}

.scheme-category-card:hover::before {
    height: 100%;
    opacity: 0.05;
}

.category-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #e65100, #ff9800);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.scheme-category-card:hover .category-icon {
    transform: scale(1.1) rotate(5deg);
}

.category-icon i {
    font-size: 2rem;
    color: #fff;
}

.category-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e65100;
    margin-bottom: 0.5rem;
}

.category-description {
    font-size: 0.9rem;
    color: #5d4037;
    margin-bottom: 1rem;
    line-height: 1.5;
    flex-grow: 1;
}

.category-count-badge {
    background: #fff8e1;
    color: #e65100;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid #ffe0b2;
}

/* ========================================
   Schemes List
======================================== */

.schemes-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.scheme-item {
    display: flex;
    gap: 1rem;
    background: #fff;
    border-left: 6px solid #ff9800;
    border-radius: 10px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.scheme-item:hover {
    background-color: #fff3e0;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(230, 81, 0, 0.15);
    border-left-width: 8px;
}

.scheme-thumbnail {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.scheme-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.scheme-item:hover .scheme-thumbnail img {
    transform: scale(1.1);
}

.scheme-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.scheme-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e65100;
    margin-bottom: 0.5rem;
}

.scheme-desc {
    font-size: 0.95rem;
    color: #5d4037;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    flex-grow: 1;
}

.scheme-item-footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.status-badge {
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-weight: 500;
}

.status-badge.status-active {
    background: #c8e6c9;
    color: #2e7d32;
}

.status-badge.status-inactive {
    background: #ffccbc;
    color: #d84315;
}

/* ========================================
   Scheme Details
======================================== */

.scheme-details {
    padding: 0.5rem 0;
}

.scheme-detail-img {
    margin-bottom: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.scheme-detail-img img {
    width: 100%;
    height: auto;
    display: block;
}

.detail-section {
    margin-bottom: 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #ffe0b2;
}

.detail-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-heading {
    font-size: 1.15rem;
    font-weight: 600;
    color: #e65100;
    margin-bottom: 1rem;
    padding-left: 1rem;
    border-left: 4px solid #ff9800;
    position: relative;
}

.detail-content {
    font-size: 1rem;
    color: #5d4037;
    line-height: 1.8;
    padding-left: 1rem;
}

.detail-content p {
    margin-bottom: 0.75rem;
}

.detail-content ul,
.detail-content ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.detail-content ul li,
.detail-content ol li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

.detail-content ul li {
    list-style-type: disc;
}

.detail-content ol li {
    list-style-type: decimal;
}

.detail-content strong {
    color: #e65100;
    font-weight: 600;
}

.detail-section .btn {
    margin-top: 0.5rem;
}

/* ========================================
   Modal Customizations
======================================== */

#schemesModal .modal-dialog {
    max-width: 900px;
}

#schemesModal .modal-header {
    background: linear-gradient(135deg, #e65100, #ff9800);
    color: #fff;
    border-bottom: none;
    padding: 1.25rem 1.5rem;
}

#schemesModal .modal-title {
    font-size: 1.4rem;
    font-weight: 700;
}

#schemesModal .modal-body {
    padding: 1.5rem;
    background-color: #fffaf0;
    max-height: 70vh;
    overflow-y: auto;
}

#schemesModal .modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

#schemesModal .btn-close {
    filter: invert(1);
    opacity: 0.9;
}

#schemesModal .btn-close:hover {
    opacity: 1;
}

#schemesBackBtn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    margin-right: 1rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

#schemesBackBtn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

#schemesBackBtn i {
    margin-right: 0.5rem;
}

/* ========================================
   Responsive Design
======================================== */

/* Tablet (768px and up) */
@media (min-width: 768px) {
    .scheme-category-card {
        padding: 2rem;
    }

    .category-icon {
        width: 80px;
        height: 80px;
    }

    .category-icon i {
        font-size: 2.5rem;
    }

    .scheme-item {
        padding: 1.5rem;
    }

    .scheme-thumbnail {
        width: 120px;
        height: 120px;
    }

    #schemesModal .modal-body {
        padding: 2rem;
    }
}

/* Desktop (992px and up) */
@media (min-width: 992px) {
    #schemesModal .modal-dialog {
        max-width: 1000px;
    }

    .scheme-category-card {
        min-height: 280px;
    }

    .category-icon {
        width: 90px;
        height: 90px;
    }

    .category-icon i {
        font-size: 3rem;
    }

    .scheme-item {
        padding: 1.75rem;
    }

    .scheme-thumbnail {
        width: 140px;
        height: 140px;
    }

    #schemesModal .modal-body {
        padding: 2.5rem;
        max-height: 75vh;
    }
}

/* Mobile (less than 576px) */
@media (max-width: 575.98px) {
    .scheme-category-card {
        padding: 1.25rem;
    }

    .category-icon {
        width: 60px;
        height: 60px;
    }

    .category-icon i {
        font-size: 1.5rem;
    }

    .category-name {
        font-size: 1rem;
    }

    .scheme-item {
        flex-direction: column;
        padding: 1rem;
    }

    .scheme-thumbnail {
        width: 100%;
        height: 180px;
    }

    .scheme-title {
        font-size: 1rem;
    }

    .scheme-desc {
        font-size: 0.9rem;
    }

    .detail-heading {
        font-size: 1rem;
    }

    .detail-content {
        font-size: 0.9rem;
        padding-left: 0.5rem;
    }

    #schemesModal .modal-dialog {
        margin: 0.5rem;
    }

    #schemesModal .modal-body {
        padding: 1rem;
        max-height: 65vh;
    }

    #schemesModal .modal-title {
        font-size: 1.1rem;
    }

    #schemesBackBtn {
        font-size: 0.9rem;
        padding: 0.3rem 0.5rem;
        margin-right: 0.5rem;
    }
}

/* ========================================
   Scrollbar Styling
======================================== */

#schemesModal .modal-body::-webkit-scrollbar {
    width: 8px;
}

#schemesModal .modal-body::-webkit-scrollbar-track {
    background: #fff8e1;
    border-radius: 10px;
}

#schemesModal .modal-body::-webkit-scrollbar-thumb {
    background: #ff9800;
    border-radius: 10px;
}

#schemesModal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #e65100;
}

/* ========================================
   Animation Keyframes
======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scheme-category-card,
.scheme-item,
.detail-section {
    animation: fadeIn 0.3s ease-out;
}

/* ========================================
   Print Styles
======================================== */

@media print {
    #schemesModal .modal-header,
    #schemesBackBtn,
    .btn-close {
        display: none;
    }

    #schemesModal .modal-body {
        max-height: none;
        overflow: visible;
        background: #fff;
    }

    .scheme-item,
    .scheme-category-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
