/**
 * HUMI Flagship Programs - WordPress Plugin Styles
 * Version: 1.2.0
 * Matching EXACT styles from https://flagship.humi.biz.id/
 */

/* CSS Variables - Same as original */
:root {
    --primary-color: #003B5C;
    --primary-dark: #002840;
    --accent-color: #00A3E0;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --radius-md: 0.5rem;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
}

/* Container */
.humi-flagship-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
    font-family: 'Open Sans', sans-serif;
}

/* Programs Grid - EXACT same as original with 6 column layout */
.program-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 30px;
    margin-bottom: 40px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    justify-items: center;
}

/* Card Styles - EXACT match with original */
.program-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    width: 100%;
    max-width: 350px;
    transition: all 0.3s ease;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr;
}

/* Card 1, 2, 3 span 2 columns each (first row) */
.program-card:nth-child(1),
.program-card:nth-child(2),
.program-card:nth-child(3) {
    grid-column: span 2;
}

/* Card 4 and 5 centered in second row - each span 2 columns */
.program-card:nth-child(4) {
    grid-column: 2 / 4;
}

.program-card:nth-child(5) {
    grid-column: 4 / 6;
}

.program-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 51, 102, 0.2);
}

/* Card Header - Colored background section */
.program-card-header {
    padding: 30px;
    background: linear-gradient(135deg, #003366 0%, #0066cc 100%);
    color: white;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 240px;
}

.program-card-header h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 10px;
    line-height: 1.3;
}

.program-card-header p {
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.4;
}

/* Card Body - White background section */
.program-card-body {
    padding: 25px;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.program-card-body p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.btn-expand {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #003366 0%, #0066cc 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-expand:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 102, 204, 0.3);
}

/* Modal Styles - EXACT match with original */
.flagship-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.flagship-modal.active {
    display: flex;
}

.flagship-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.flagship-modal-content {
    position: relative;
    z-index: 1000000;
    background: white;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.flagship-modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 10;
    color: var(--gray-600);
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.flagship-modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.flagship-modal-body {
    padding: var(--spacing-xl);
    overflow-y: auto;
    max-height: 85vh;
}

/* Modal Content - Using exact class names and variables from original */
.modal-header {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 2px solid var(--gray-200);
}

.modal-title {
    font-size: 2rem;
    font-weight: var(--font-weight-bold);
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.modal-category {
    font-size: 0.875rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-subtopics {
    margin-bottom: var(--spacing-lg);
}

.modal-subtopics h3 {
    font-size: 1.125rem;
    font-weight: var(--font-weight-semibold);
    color: var(--gray-800);
    margin-bottom: var(--spacing-md);
}

.modal-subtopics ul {
    list-style: none;
}

.modal-subtopics li {
    padding: var(--spacing-sm);
    padding-left: var(--spacing-lg);
    margin-bottom: var(--spacing-xs);
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent-color);
    position: relative;
}

.modal-description {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--gray-700);
}

.modal-description h4 {
    font-size: 1.125rem;
    font-weight: var(--font-weight-semibold);
    color: var(--primary-color);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

.modal-description p {
    margin-bottom: var(--spacing-md);
}

.modal-description ul,
.modal-description ol {
    margin-left: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.modal-description li {
    margin-bottom: var(--spacing-xs);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading State */
.flagship-loading {
    text-align: center;
    padding: 60px 20px;
}

.flagship-loading i {
    font-size: 48px;
    color: #0066cc;
    margin-bottom: 20px;
    display: block;
}

.flagship-loading p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* Error State */
.flagship-error,
.flagship-no-data {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #856404;
    font-size: 16px;
}

/* Responsive Design - EXACT same as original */
@media (max-width: 1024px) {
    .program-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .program-card:nth-child(1),
    .program-card:nth-child(2),
    .program-card:nth-child(3),
    .program-card:nth-child(4),
    .program-card:nth-child(5) {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .humi-flagship-container {
        padding: 0 15px;
    }

    .program-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .program-card:nth-child(1),
    .program-card:nth-child(2),
    .program-card:nth-child(3),
    .program-card:nth-child(4),
    .program-card:nth-child(5) {
        grid-column: span 1;
    }

    .program-card-header {
        padding: 25px;
        min-height: 200px;
    }

    .program-card-header h3 {
        font-size: 1.25rem;
    }

    .program-card-body {
        padding: 20px;
    }

    .flagship-modal-content {
        width: 95%;
        max-height: 90vh;
        border-radius: 12px;
    }

    .flagship-modal-body {
        padding: 25px;
    }

    .modal-title {
        font-size: 1.5rem;
    }
}

/* Prevent body scroll when modal is open */
body.flagship-modal-open {
    overflow: hidden;
}