/**
 * Oracle Lead Cards - Frontend Styles
 * Elementor-friendly, responsive design
 */

/* Container */
.olc-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

/* Deck header / instructions */
.olc-deck-header {
    text-align: center;
    padding: 10px 0 30px;
}

.olc-deck-title {
    margin: 0;
    font-size: 44px;
    line-height: 1.2;
    color: #1f2937;
    font-weight: 700;
}

.olc-deck-subtitle {
    margin: 20px 0 10px;
    font-size: 22px;
    color: #111827;
    font-weight: 700;
}

.olc-deck-description {
    margin: 0 auto;
    max-width: 780px;
    font-size: 16px;
    line-height: 1.7;
    color: #4b5563;
}

/* Email Form */
.olc-email-form {
    text-align: center;
    padding: 26px 20px;
    background: transparent;
    border-radius: 0;
    max-width: 980px;
    margin: 0 auto;
}

/* Email bar (input + button like the provided example) */
.olc-email-bar {
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: center;
}

.olc-email-input {
    width: min(640px, 92vw);
    padding: 16px 22px;
    font-size: 18px;
    border: 1px solid #00616f;
    border-radius: 12px;
    transition: box-shadow 0.2s ease, background 0.2s ease;
    box-sizing: border-box;
    background: #fff;
    color: #111827;
}

.olc-email-input:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 97, 111, 0.22);
}

.olc-submit-btn {
    background: #00616f;
    color: #fff;
    border: none;
    padding: 16px 36px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    min-width: 190px;
}

.olc-submit-btn:hover {
    transform: translateY(-2px);
    background: #004e59;
    box-shadow: 0 10px 26px rgba(0, 97, 111, 0.28);
}

.olc-submit-btn:active {
    transform: translateY(0);
}

.olc-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.olc-form-message {
    margin-top: 15px;
}

.olc-message {
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
}

.olc-message-error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.olc-message-success {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

/* Honeypot (hidden) */
.olc-honeypot {
    display: none !important;
    visibility: hidden !important;
}

/* Carousel Container */
.olc-carousel-container {
    margin: 40px 0;
    position: relative;
    overflow: visible;
    padding: 20px 0;
}

.olc-carousel {
    position: relative;
    width: 100%;
    height: 500px;
    margin: 0 auto;
    padding: 0;
}

/* Carousel Nav */
.olc-nav {
    position: absolute;
    top: 50%;
    /* Allow pushing arrows outside the carousel without breaking :active scaling */
    --olc-nav-x: 0%;
    transform: translate3d(var(--olc-nav-x), -50%, 0);
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 0;
    background: rgba(17, 24, 39, 0.35);
    color: #fff;
    cursor: pointer;
    z-index: 50;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    transition: background 0.2s ease, transform 0.2s ease;
}

.olc-nav:hover {
    background: rgba(17, 24, 39, 0.55);
}

.olc-nav:active {
    transform: translate3d(var(--olc-nav-x), -50%, 0) scale(0.98);
}

.olc-nav:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(46, 166, 201, 0.35);
}

.olc-nav-prev {
    left: 0;
    /* Put the arrow OUTSIDE of the card arc */
    --olc-nav-x: -460%;
}

.olc-nav-next {
    right: 0;
    /* Put the arrow OUTSIDE of the card arc */
    --olc-nav-x: 460%;
}

.olc-nav span {
    font-size: 30px;
    line-height: 1;
}

/* Card */
.olc-card {
    flex: 0 0 auto;
    width: 270px;
    height: 405px;
    perspective: 1000px;
    cursor: pointer;
    position: absolute;
    left: 50%;
    top: 50%;
    transform-origin: center;
    transition: transform 320ms ease, filter 320ms ease, opacity 320ms ease;
    outline: none;
}

.olc-card:hover {
    filter: brightness(1.02);
}

.olc-card:focus-visible {
    box-shadow: 0 0 0 4px rgba(46, 166, 201, 0.35);
    border-radius: 14px;
}

/* Curved / arc layout (5 visible cards)
   Positions: -2, -1, 0, 1, 2
*/
.olc-card.olc-pos-0 {
    transform: translate(-50%, -50%) translateX(0) translateY(-20px) scale(1.18) rotate(0deg);
    opacity: 1;
    filter: none;
}

.olc-card.olc-pos-n1 {
    transform: translate(-50%, -50%) translateX(-220px) translateY(10px) scale(1.02) rotate(-9deg);
    opacity: 0.96;
}

.olc-card.olc-pos-1 {
    transform: translate(-50%, -50%) translateX(220px) translateY(10px) scale(1.02) rotate(9deg);
    opacity: 0.96;
}

.olc-card.olc-pos-n2 {
    transform: translate(-50%, -50%) translateX(-420px) translateY(55px) scale(0.90) rotate(-14deg);
    opacity: 0.88;
}

.olc-card.olc-pos-2 {
    transform: translate(-50%, -50%) translateX(420px) translateY(55px) scale(0.90) rotate(14deg);
    opacity: 0.88;
}

.olc-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.olc-card.olc-flipped .olc-card-inner {
    transform: rotateY(180deg);
}

.olc-card-front,
.olc-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.olc-card-front img,
.olc-card-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.olc-card-back {
    transform: rotateY(180deg);
    background: #fff;
}

/* Revealed Cards */
.olc-revealed-cards {
    margin-top: 40px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 10px;
}

/* Modal (popup to view multiple cards) */
.olc-modal {
    display: none;
}

.olc-modal.is-open {
    display: block;
}

.olc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9998;
}

.olc-modal-panel {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(860px, 96vw);
    /* no scrolling inside the popup */
    max-height: 92vh;
    overflow: hidden;
    z-index: 9999;
    /* transparent / glass popup */
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(12px);
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.olc-modal-close {
    position: absolute;
    right: 12px;
    top: 10px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    cursor: pointer;
    font-size: 26px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.olc-modal-close:hover {
    background: rgba(17, 24, 39, 0.14);
}

.olc-modal-close:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(46, 166, 201, 0.35);
}

.olc-modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 14px;
}

.olc-modal-media {
    /* Keep the card near its natural aspect ratio (1050x1500) but not full-screen */
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 0 auto;
    border-radius: 14px;
    overflow: hidden;
    background: transparent;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

.olc-modal-img {
    display: block;
    width: auto;
    height: auto;
    /* cap the image so it stays readable but not huge */
    max-width: min(760px, 94vw);
    /* ensure the whole card is visible without scrolling */
    max-height: 86vh;
    object-fit: contain;
}

.olc-modal-meta {
    /* Hide meta so the modal never needs internal scroll.
       The card image itself contains the readable text. */
    display: none;
}

.olc-modal-title {
    margin: 0 0 10px;
    font-size: 28px;
    line-height: 1.2;
    color: #fff;
    font-weight: 800;
}

.olc-modal-description {
    margin: 0;
    font-size: 16px;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.88);
    white-space: pre-wrap;
}

body.olc-modal-open {
    overflow: hidden;
}

/* Elementor integration helpers (unlock state)
   After email submit, JS adds body.olc-unlocked.
   Use this to reveal/center Elementor containers if needed.
*/
body.olc-unlocked .elementor-37909 .elementor-element.elementor-element-fafe021 {
    /* Elementor flex container variables (new container engine) */
    --justify-content: center;
    --align-items: center;
    --flex-direction: column;

    /* Fallback for classic flex containers */
    justify-content: center !important;
    align-items: center !important;
    text-align: center;
}

/* Selected (single) card */
.olc-selected-card {
    margin: 40px auto 0;
    text-align: center;
}

.olc-selected-title {
    margin: 0 0 18px;
    font-size: 20px;
    color: #111827;
    font-weight: 700;
}

.olc-selected-frame {
    display: inline-block;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
    background: #fff;
}

.olc-selected-img {
    display: block;
    width: min(680px, 94vw);
    height: auto;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.olc-selected-meta {
    max-width: 820px;
    margin: 22px auto 0;
    text-align: center;
}

.olc-selected-name {
    margin: 0 0 10px;
    font-size: 28px;
    line-height: 1.25;
    color: #111827;
    font-weight: 800;
}

.olc-selected-description {
    margin: 0 auto;
    font-size: 16px;
    line-height: 1.75;
    color: #4b5563;
    white-space: pre-wrap;
}

.olc-animate-in {
    animation: olcPopIn 420ms ease-out;
}

@keyframes olcPopIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.olc-revealed-title {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #333;
    font-weight: 600;
    text-align: center;
}

.olc-revealed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.olc-revealed-card {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.olc-revealed-card img {
    width: 100%;
    height: auto;
    display: block;
}

/* Error */
.olc-error {
    padding: 20px;
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
    border-radius: 6px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .olc-container {
        padding: 15px;
    }
    
    .olc-email-form {
        padding: 30px 15px;
    }
    
    .olc-form-title {
        font-size: 20px;
    }

    .olc-deck-title {
        font-size: 32px;
    }
    
    .olc-card {
        width: 200px;
        height: 300px;
    }

    .olc-carousel {
        height: 380px;
    }

    .olc-card.olc-pos-0 {
        transform: translate(-50%, -50%) translateX(0) translateY(-10px) scale(1.16) rotate(0deg);
    }

    .olc-card.olc-pos-n1 {
        transform: translate(-50%, -50%) translateX(-160px) translateY(10px) scale(1.00) rotate(-9deg);
    }

    .olc-card.olc-pos-1 {
        transform: translate(-50%, -50%) translateX(160px) translateY(10px) scale(1.00) rotate(9deg);
    }

    .olc-card.olc-pos-n2 {
        transform: translate(-50%, -50%) translateX(-300px) translateY(34px) scale(0.86) rotate(-14deg);
    }

    .olc-card.olc-pos-2 {
        transform: translate(-50%, -50%) translateX(300px) translateY(34px) scale(0.86) rotate(14deg);
    }

    .olc-modal-panel {
        width: 96vw;
        max-height: 92vh;
    }

    .olc-modal-body {
        padding: 14px;
    }

    .olc-email-bar {
        flex-direction: column;
        gap: 12px;
    }

    .olc-email-input {
        width: min(560px, 92vw);
    }

    .olc-submit-btn {
        width: min(280px, 92vw);
    }

    .olc-selected-name {
        font-size: 22px;
    }
    
    .olc-revealed-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .olc-card {
        width: 145px;
        height: 218px;
    }

    .olc-carousel {
        height: 290px;
    }

    .olc-card.olc-pos-0 {
        transform: translate(-50%, -50%) translateX(0) translateY(-6px) scale(1.14) rotate(0deg);
    }

    .olc-card.olc-pos-n1 {
        transform: translate(-50%, -50%) translateX(-120px) translateY(12px) scale(0.98) rotate(-10deg);
    }

    .olc-card.olc-pos-1 {
        transform: translate(-50%, -50%) translateX(120px) translateY(12px) scale(0.98) rotate(10deg);
    }

    .olc-card.olc-pos-n2 {
        transform: translate(-50%, -50%) translateX(-220px) translateY(32px) scale(0.82) rotate(-16deg);
        opacity: 0.85;
    }

    .olc-card.olc-pos-2 {
        transform: translate(-50%, -50%) translateX(220px) translateY(32px) scale(0.82) rotate(16deg);
        opacity: 0.85;
    }
    
    .olc-revealed-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* Elementor Compatibility */
.elementor-widget-olc-oracle-cards .olc-container {
    padding: 0;
    max-width: 100%;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .olc-email-form,
    .olc-revealed-cards {
        background: #fff;
    }
    
    .olc-form-title,
    .olc-revealed-title {
        color: #111827;
    }
    
    .olc-email-input {
        background: #fff;
        border-color: #00616f;
        color: #111827;
    }
}
