/* ============================================
   Jungbluth Dashboard - Production Ready
   ============================================ */

:root {
    --jb-primary: #0A3D91;
    --jb-secondary: #3FA9F5;
    --jb-gold: #C5A059;
    --bg: #F8F9FA;
    --white: #FFFFFF;
    --text: #1E293B;
    --text-light: #64748B;
    --border: #E2E8F0;
    --shadow: rgba(10, 61, 145, 0.08);
}

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

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    padding: 3rem 1.5rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* === Header === */
.header {
    text-align: center;
    margin-bottom: 4rem;
}

.logos-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
}

.header-logo {
    max-height: 70px;
    max-width: 280px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px var(--shadow));
    transition: transform 0.3s ease;
}

.header-logo:first-child {
    max-height: 80px;
    max-width: 300px;
}

.header-logo:hover {
    transform: scale(1.05);
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--jb-primary);
    margin-bottom: 0.75rem;
}

.tagline {
    font-size: 1.125rem;
    color: var(--text-light);
    font-weight: 400;
}

/* === Grid === */
.grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Top row: 3 website cards spanning 2 columns each */
.card:nth-child(1),
.card:nth-child(2),
.card:nth-child(3) {
    grid-column: span 2;
}

/* Bottom row: 2 logo cards centered and equally spaced */
.logo-card:nth-child(4) {
    grid-column: 2 / 4;
}

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

/* === Cards === */
.card {
    background: var(--white);
    border-radius: 1rem;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px var(--shadow);
    display: block;
    border: 2px solid transparent;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(10, 61, 145, 0.15);
    border-color: var(--jb-secondary);
}

.card-image {
    height: 280px;
    background: linear-gradient(135deg, #F1F5F9 0%, #E2E8F0 100%);
    position: relative;
    overflow: hidden;
}

/* === Live Preview Iframes === */
.preview-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 400%;
    height: 400%;
    border: none;
    pointer-events: none;
    transform: scale(0.25);
    transform-origin: 0 0;
}

.preview-overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    z-index: 1;
}

/* === Logo Preview Grid === */
.logo-preview {
    background: linear-gradient(135deg, var(--jb-primary) 0%, var(--jb-secondary) 100%);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 1rem;
}

.logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0.5rem;
    padding: 0.5rem;
    transition: all 0.2s ease;
}

.logo-preview img:hover {
    transform: scale(1.05);
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card h2 {
    padding: 1.25rem 1.75rem 0.5rem;
    font-size: 1.375rem;
    font-weight: 600;
    text-align: center;
    color: var(--jb-primary);
    background: white;
}

.card-subtitle {
    padding: 0 1.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    color: var(--text-light);
    background: white;
}

/* === Modal === */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 61, 145, 0.85);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 1rem;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(10, 61, 145, 0.4);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #F8FAFC 0%, #FFFFFF 100%);
}

.modal-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--jb-primary);
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-light);
    transition: all 0.2s;
    border-radius: 0.5rem;
}

.modal-close:hover {
    color: var(--jb-primary);
    background: rgba(10, 61, 145, 0.05);
}

.modal-close svg {
    width: 24px;
    height: 24px;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    align-content: start;
}

.logo-item {
    background: white;
    border: 2px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.25s ease;
    cursor: pointer;
}

.logo-item:hover {
    border-color: var(--jb-secondary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow);
}

.logo-item img {
    width: 100%;
    height: 160px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.logo-item .logo-name {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
    line-height: 1.4;
    word-break: break-word;
}

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

@media (max-width: 640px) {
    body {
        padding: 2rem 1rem;
    }

    .header {
        margin-bottom: 3rem;
    }

    .logos-container {
        gap: 2rem;
    }

    .header h1 {
        font-size: 2rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .card-image {
        height: 220px;
    }

    .card h2 {
        font-size: 1.25rem;
        padding: 1rem 1.5rem 0.5rem;
    }

    .card-subtitle {
        padding: 0 1.5rem 1rem;
    }

    .modal-body {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
        padding: 1.5rem;
    }

    .logo-item {
        padding: 1rem;
    }

    .logo-item img {
        height: 120px;
    }
}

/* === Animations === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.card {
    animation: fadeIn 0.5s ease;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.3s; }

.modal.active {
    animation: modalFadeIn 0.25s ease;
}
