/**
 * HUMI Flagship Cards - Minimal CSS
 * Non-intrusive styling for WordPress integration
 */

/* ===== CONTAINER ===== */
.humi-flagship-cards-container {
    width: 100%;
    margin: 20px 0;
}

.humi-flagship-cards-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 24px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

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

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

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

/* ===== LOADING STATE ===== */
.humi-cards-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

/* ===== CARD STYLES ===== */
.humi-flagship-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.humi-flagship-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

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

.humi-card-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.9;
}

.humi-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
    color: white !important;
}

.humi-card-category {
    font-size: 13px;
    opacity: 0.85;
    font-weight: 500;
    color: white !important;
}

/* Card Body */
.humi-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.humi-card-summary {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 16px;
}

.humi-card-button {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #003366 0%, #0066cc 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.humi-card-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

/* ===== MODAL STYLES ===== */
.humi-card-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.humi-card-modal.active {
    display: flex;
}

.humi-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
    backdrop-filter: blur(2px);
}

.humi-modal-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.humi-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #374151;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 0;
    line-height: 1;
}

.humi-modal-close:hover {
    background: #1F2937;
    transform: scale(1.1);
}

.humi-modal-close:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

#humiModalBody {
    flex: 1;
    padding: 40px;
    color: #1F2937;
    overflow-y: auto;
}

/* ===== MODAL CONTENT ===== */
.humi-modal-header {
    background: white;
    padding: 0 0 30px 0;
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #E5E7EB;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.humi-modal-header .humi-card-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #003366 0%, #0066cc 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 50px;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
}

.humi-modal-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #003366;
    line-height: 1.2;
}

.humi-modal-subtitle {
    font-size: 16px;
    color: #6B7280;
    font-weight: 500;
}

.humi-modal-body-content {
    font-size: 16px;
    line-height: 1.8;
    color: #374151;
}

.humi-modal-body-content p {
    margin-bottom: 20px;
    text-align: justify;
}

.humi-modal-body-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #003366;
}

.humi-modal-body-content ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

.humi-modal-body-content li {
    margin-bottom: 10px;
    color: #374151;
}

/* ===== DETAILED MODAL STYLES ===== */
.humi-modal-header-detailed {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0 0 30px 0;
    margin-bottom: 30px;
    border-bottom: 2px solid #E5E7EB;
}

.humi-modal-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.humi-modal-icon-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #003366 0%, #0066cc 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
    flex-shrink: 0;
}

.humi-modal-header-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.humi-modal-header-text .humi-modal-title {
    font-size: 28px;
    font-weight: 700;
    color: #003366;
    margin: 0;
    text-align: left;
}

.humi-modal-date {
    font-size: 14px;
    color: #6B7280;
    margin: 0;
}

.humi-modal-header-right {
    flex-shrink: 0;
}

.humi-modal-sdg-badge {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.humi-modal-sdg-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.humi-modal-section {
    margin-bottom: 40px;
}

.humi-modal-section-title {
    font-size: 20px;
    font-weight: 600;
    color: #0066cc;
    margin-bottom: 20px;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #E5E7EB;
}

.humi-modal-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.humi-modal-cards-grid-2 {
    grid-template-columns: repeat(2, 1fr);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.humi-modal-compliance-card {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.humi-modal-compliance-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.humi-modal-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 15px;
}

.humi-modal-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 15px;
    line-height: 1.3;
}

.humi-modal-metric {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.humi-modal-metric-label {
    font-size: 13px;
    color: #6B7280;
}

.humi-modal-metric-value {
    font-size: 24px;
    font-weight: 700;
    color: #10B981;
}

.humi-modal-status-badge {
    background: #D1FAE5;
    color: #065F46;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.humi-modal-progress-bar {
    width: 100%;
    height: 8px;
    background: #E5E7EB;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.humi-modal-progress-fill {
    height: 100%;
    background: #10B981;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.humi-modal-progress-label {
    font-size: 12px;
    color: #6B7280;
    text-align: center;
    margin: 0;
}

.humi-modal-image-section {
    margin-top: 40px;
    text-align: center;
}

.humi-modal-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .humi-modal-content {
        max-width: 95%;
    }

    #humiModalBody {
        padding: 35px;
    }

    .humi-modal-title {
        font-size: 28px;
    }

    .humi-modal-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .humi-modal-cards-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .humi-flagship-cards-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .humi-card-header {
        min-height: 150px;
        padding: 20px;
    }

    .humi-card-icon {
        font-size: 36px;
    }

    .humi-card-title {
        font-size: 16px;
    }

    .humi-card-modal {
        padding: 15px;
    }

    .humi-modal-content {
        max-height: 95vh;
        border-radius: 12px;
    }

    .humi-modal-close {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    #humiModalBody {
        padding: 25px;
    }

    .humi-modal-header {
        margin-bottom: 25px;
        padding-bottom: 25px;
    }

    .humi-modal-header .humi-card-icon {
        width: 80px;
        height: 80px;
        font-size: 40px;
        margin-bottom: 15px;
    }

    .humi-modal-title {
        font-size: 24px;
        margin-bottom: 8px;
    }

    .humi-modal-subtitle {
        font-size: 14px;
    }

    .humi-modal-body-content {
        font-size: 15px;
        line-height: 1.7;
    }

    .humi-modal-header-detailed {
        flex-direction: column;
        gap: 20px;
    }

    .humi-modal-header-left {
        flex-direction: column;
        text-align: center;
        width: 100%;
    }

    .humi-modal-header-text .humi-modal-title {
        text-align: center;
        font-size: 22px;
    }

    .humi-modal-icon-circle {
        width: 70px;
        height: 70px;
        font-size: 35px;
    }

    .humi-modal-header-right {
        align-self: center;
    }

    .humi-modal-sdg-badge {
        width: 70px;
        height: 70px;
    }

    .humi-modal-cards-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .humi-modal-cards-grid-2 {
        grid-template-columns: 1fr;
    }

    .humi-modal-section-title {
        font-size: 18px;
    }

    .humi-modal-card-title {
        font-size: 15px;
    }

    .humi-modal-metric-value {
        font-size: 20px;
    }

    .humi-modal-body-content h3 {
        font-size: 18px;
        margin-top: 25px;
        margin-bottom: 12px;
    }
}

@media (max-width: 480px) {
    .humi-card-modal {
        padding: 10px;
    }

    .humi-modal-content {
        max-height: 98vh;
        border-radius: 10px;
    }

    .humi-modal-close {
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    #humiModalBody {
        padding: 20px;
    }

    .humi-modal-header {
        margin-bottom: 20px;
        padding-bottom: 20px;
    }

    .humi-modal-header .humi-card-icon {
        width: 70px;
        height: 70px;
        font-size: 35px;
        margin-bottom: 12px;
    }

    .humi-modal-title {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .humi-modal-subtitle {
        font-size: 13px;
    }

    .humi-modal-body-content {
        font-size: 14px;
        line-height: 1.6;
    }

    .humi-modal-body-content p {
        margin-bottom: 15px;
        text-align: left;
    }

    .humi-modal-body-content h3 {
        font-size: 16px;
        margin-top: 20px;
        margin-bottom: 10px;
    }

    .humi-modal-body-content ul {
        margin-left: 15px;
        margin-bottom: 15px;
    }

    .humi-modal-body-content li {
        margin-bottom: 8px;
        font-size: 14px;
    }
}

/* ===== RESPONSIVE GRID LAYOUT ===== */
@media (max-width: 1024px) {
    .humi-flagship-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

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

@media (max-width: 768px) {
    .humi-flagship-cards-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

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

/* ===== ACCESSIBILITY ===== */
.humi-flagship-card:focus,
.humi-card-button:focus,
.humi-modal-close:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {

    .humi-card-button,
    .humi-modal-close {
        display: none;
    }
}