/* Reset & Base */
:root {
    --brand-navy: #038599;
    --brand-blue: #038599;
    --brand-gold: #f2a900;
    --bg-color: #f0f4f8;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success: #10b981;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, var(--brand-navy) 0%, #00102e 100%);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.hidden {
    display: none !important;
}

/* Typography Helpers */
h1, h2, h3, h4, p { margin-top: 0; }
a { color: var(--brand-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.text-center { text-align: center; }

/* Layout */
.page-wrapper {
    min-height: 100vh;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* The Card */
.gleam-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 560px;
    overflow: hidden;
    position: relative;
    margin-bottom: 30px;
}

/* Card Hero Image */
.card-hero {
    width: 100%;
    height: 300px;
    background: var(--brand-navy);
    position: relative;
}
.card-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Card Header Overlay */
.card-header-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,32,91,0.95), rgba(0,32,91,0.6) 60%, transparent);
    padding: 60px 30px 24px;
    color: #fff;
}
.brand-tag {
    display: inline-block;
    background: var(--brand-blue);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 12px;
}
.card-header-overlay h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.card-header-overlay p {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 0;
    line-height: 1.5;
}

/* Stats Bar */
.card-stats {
    display: flex;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
}
.stat-box {
    flex: 1;
    text-align: center;
    padding: 16px 10px;
    position: relative;
}
.stat-box:first-child::after {
    content: '';
    position: absolute;
    right: 0; top: 20%; bottom: 20%;
    width: 1px;
    background: var(--border-color);
}
.stat-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--brand-navy);
    line-height: 1.1;
    margin-bottom: 4px;
}
.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

/* Action List */
.action-list {
    padding: 20px 24px 24px;
    background: #f8fafc;
}
.action-row {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.3s ease;
}
.action-row:last-child {
    margin-bottom: 0;
}
.action-row:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.action-row.active {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 1px var(--brand-blue), 0 4px 12px rgba(0,114,206,0.15);
}

.row-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.row-header:hover {
    background-color: #fcfcfd;
}

/* Completed state styling */
.action-row.completed {
    border-color: #d1fae5;
    background-color: #f0fdf4;
    box-shadow: none;
}
.action-row.completed .row-header {
    background-color: #f0fdf4;
}
.action-row.completed .row-label {
    color: #166534;
    text-decoration: line-through;
    opacity: 0.7;
}
.action-row.completed .points {
    display: none;
}
.action-row.completed .check-icon {
    display: block !important;
    width: 20px;
    height: 20px;
    color: var(--success);
}

/* Needs-entry state styling (shaking animation class) */
.action-row.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    border-color: #ef4444;
    background-color: #fef2f2;
}
@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

.row-icon {
    width: 24px;
    height: 24px;
    color: var(--brand-navy);
    margin-right: 16px;
    flex-shrink: 0;
}
.row-icon svg {
    width: 100%;
    height: 100%;
}
.row-label {
    flex-grow: 1;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
    transition: color 0.2s;
}
.row-badge {
    flex-shrink: 0;
    margin-left: 12px;
}
.points {
    display: inline-block;
    background: #e0f2fe;
    color: var(--brand-blue);
    border: 1px solid #bae6fd;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Expandable Content */
.row-content {
    background: #f8fafc;
    border-top: 1px solid var(--border-color);
}
.content-inner {
    padding: 20px;
}
.content-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Forms & Inputs */
.input-group {
    margin-bottom: 12px;
}
input[type="text"], input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-main);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(0, 114, 206, 0.15);
}

.error-msg {
    color: #dc2626;
    font-size: 0.85rem;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #fef2f2;
    border-radius: 4px;
    border-left: 3px solid #ef4444;
}

/* Buttons */
.btn {
    display: inline-block;
    width: 100%;
    padding: 12px 20px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
.btn-primary {
    background-color: var(--brand-blue);
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 114, 206, 0.2);
}
.btn-primary:hover:not(:disabled) {
    background-color: #005fbc;
    transform: translateY(-1px);
    box-shadow: 0 6px 10px -1px rgba(0, 114, 206, 0.3);
}

/* Share Panel */
.share-input-wrap {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.share-input-wrap input {
    flex-grow: 1;
    background: #fff;
    cursor: copy;
}
.share-input-wrap .btn {
    width: auto;
    background: #e2e8f0;
    color: var(--text-main);
    border-radius: 6px;
}
.share-input-wrap .btn:hover {
    background: #cbd5e1;
}

.social-share-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.btn-social {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-social:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.btn-social.fb { background: #1877F2; }
.btn-social.tw { background: #000000; }

/* Footer */
.card-footer {
    padding: 16px 24px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background: #fff;
}
.card-footer a {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}
.card-footer a:hover {
    color: var(--brand-blue);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 32, 91, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2), 0 10px 10px -5px rgba(0,0,0,0.1);
}
.modal-lg {
    max-width: 600px;
}
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--brand-navy);
    font-family: 'Montserrat', sans-serif;
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}
.modal-close:hover {
    color: #ef4444;
}
.modal-body {
    padding: 24px;
    overflow-y: auto;
}
.rules-content {
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: pre-wrap;
}

/* Powered by slot */
#wbx-powered-by-slot {
    margin-top: auto;
    padding-top: 20px;
    width: 100%;
}

@media (max-width: 600px) {
    .page-wrapper {
        padding: 20px 15px;
    }
    .gleam-card {
        margin-bottom: 20px;
    }
    .card-hero {
        height: 240px;
    }
    .card-header-overlay {
        padding: 40px 20px 20px;
    }
    .card-header-overlay h1 {
        font-size: 1.5rem;
    }
    .action-list {
        padding: 15px;
    }
}