@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700;800&family=Zen+Kaku+Gothic+New:wght@400;500;700&display=swap');

/* Animations */
.reveal {
  position: relative;
  transform: translateY(50px);
  opacity: 0;
  transition: all 1.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.reveal.active {
  transform: translateY(0);
  opacity: 1;
}

:root {
    --sea-color-happy: #e1f5fe;
    --sea-color-joy: #fff3e0;
    --sea-color-negative: #eceff1;
    --sea-color-hurt: #f8bbd0;
    --sea-color-suffering: #cfd8dc;
    
    --sea-accent-happy: #0288d1;
    --sea-accent-joy: #ef6c00;
    --sea-accent-negative: #546e7a;
    --sea-accent-hurt: #c2185b;
    --sea-accent-suffering: #37474f;

    --radar-color: #4fc3f7;
    --text-color: #5d4037;
    --healing-gradient: linear-gradient(135deg, #fff5f7 0%, #e3f2fd 100%);
}

/* Page Background & Layout */
body {
    background: linear-gradient(135deg, #fff5f7 0%, #e3f2fd 100%);
    background-size: 400% 400%;
    animation: breathingSea 15s ease infinite;
    font-family: 'Zen Kaku Gothic New', sans-serif;
    color: var(--text-color);
}

@keyframes breathingSea {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.content-body {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 10;
}

/* Typography Styling */
.lead-text {
    font-size: 1.25rem;
    line-height: 2;
    text-align: center;
    color: var(--text-color);
    margin: 3rem auto 5rem;
    max-width: 800px;
    font-feature-settings: "palt";
    background: rgba(255, 255, 255, 0.6);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    backdrop-filter: blur(5px);
}

h2 {
    font-size: 2rem;
    color: var(--text-color);
    text-align: center;
    margin: 5rem 0 3rem;
    position: relative;
    padding-bottom: 20px;
}

h2::after {
    content: '\f21a'; /* Ship icon anchor */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    display: block;
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    color: var(--radar-color);
    opacity: 0.5;
    background: transparent;
}

h3 {
    font-size: 1.6rem;
    color: var(--text-color);
    margin: 3rem 0 1.5rem;
    padding-left: 1rem;
    border-left: 5px solid var(--radar-color);
    background: linear-gradient(to right, rgba(79, 195, 247, 0.1), transparent);
    padding: 0.5rem 1rem;
    border-radius: 0 10px 10px 0;
}

/* Paragraphs */
.content-body > p {
    font-size: 1.05rem;
    line-height: 1.9;
    color: #4a4a4a;
    margin-bottom: 2rem;
}

/* 3D Flip Card Scene */
.sea-types-grid {
    display: flex;
    flex-direction: column;
    gap: 4rem; /* Increased gap */
    padding: 1rem;
    max-width: 800px;
    margin: 3rem auto 5rem;
}

.sea-card-scene {
    background-color: transparent;
    perspective: 1000px; /* Enable 3D perspective */
    height: 550px; /* Increased height to fit content */
}

/* The Card Itself */
.sea-card {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    cursor: pointer;
}

/* Flip on Hover (and focus for accessibility) */
.sea-card-scene:hover .sea-card,
.sea-card-scene:focus-within .sea-card,
.sea-card.is-flipped {
    transform: rotateY(180deg);
}

.sea-card-scene:hover .card-icon {
    transform: scale(1.1);
}

/* Common Face Styles */
.sea-card-front, .sea-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden;
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* --- FRONT FACE: Description --- */
.sea-card-front {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.8);
    color: var(--text-color);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: floatShip 4s ease-in-out infinite;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

@keyframes floatShip {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

.sea-card h4 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.sea-card-front p {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: auto;
}

.flip-hint {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #999;
    background: rgba(255,255,255,0.8);
    padding: 0.4rem 1.2rem;
    border-radius: 50px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.flip-hint i {
    transition: transform 0.5s;
}

.sea-card-scene:hover .flip-hint i {
    transform: rotate(180deg);
}

/* --- BACK FACE: Reflection + AI Message --- */
.sea-card-back {
    background: linear-gradient(135deg, #fff 0%, #f9f9f9 100%);
    color: var(--text-color);
    transform: rotateY(180deg);
    justify-content: space-between;
    border: 2px solid transparent;
}

/* Reflection Box (Top) */
.reflection-box {
    background: rgba(255, 255, 255, 0.8);
    padding: 1.2rem;
    border-radius: 12px;
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 1rem;
    border-left: 5px solid #ccc;
    text-align: left;
    width: 100%;
}

/* AI Message (Bottom, Emphasized) */
.ai-message {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.06);
    position: relative;
    width: 100%;
    text-align: left;
}

.ai-message h5 {
    font-size: 1rem;
    color: var(--sea-accent-happy); /* Default fallback */
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}

.ai-message p {
    font-size: 1rem;
    line-height: 1.8;
    font-weight: 500;
    color: #444;
}

/* --- COLOR VARIANTS --- */

/* Happy */
.sea-card.happy .sea-card-front {
    background: linear-gradient(to bottom right, white, var(--sea-color-happy));
    border-top: 5px solid var(--sea-accent-happy);
}
.sea-card.happy .card-icon { color: var(--sea-accent-happy); }
.sea-card.happy .sea-card-back { border-color: var(--sea-accent-happy); }
.sea-card.happy .reflection-box { border-left-color: var(--sea-accent-happy); }
.sea-card.happy .ai-message h5 { color: var(--sea-accent-happy); }

/* Joy */
.sea-card.joy .sea-card-front {
    background: linear-gradient(to bottom right, white, var(--sea-color-joy));
    border-top: 5px solid var(--sea-accent-joy);
}
.sea-card.joy .card-icon { color: var(--sea-accent-joy); }
.sea-card.joy .sea-card-back { border-color: var(--sea-accent-joy); }
.sea-card.joy .reflection-box { border-left-color: var(--sea-accent-joy); }
.sea-card.joy .ai-message h5 { color: var(--sea-accent-joy); }

/* Negative */
.sea-card.negative .sea-card-front {
    background: linear-gradient(to bottom right, white, var(--sea-color-negative));
    border-top: 5px solid var(--sea-accent-negative);
}
.sea-card.negative .card-icon { color: var(--sea-accent-negative); }
.sea-card.negative .sea-card-back { border-color: var(--sea-accent-negative); }
.sea-card.negative .reflection-box { border-left-color: var(--sea-accent-negative); }
.sea-card.negative .ai-message h5 { color: var(--sea-accent-negative); }

/* Hurt */
.sea-card.hurt .sea-card-front {
    background: linear-gradient(to bottom right, white, var(--sea-color-hurt));
    border-top: 5px solid var(--sea-accent-hurt);
}
.sea-card.hurt .card-icon { color: var(--sea-accent-hurt); }
.sea-card.hurt .sea-card-back { border-color: var(--sea-accent-hurt); }
.sea-card.hurt .reflection-box { border-left-color: var(--sea-accent-hurt); }
.sea-card.hurt .ai-message h5 { color: var(--sea-accent-hurt); }

/* Suffering */
.sea-card.suffering .sea-card-front {
    background: linear-gradient(to bottom right, white, var(--sea-color-suffering));
    border-top: 5px solid var(--sea-accent-suffering);
}
.sea-card.suffering .card-icon { color: var(--sea-accent-suffering); }
.sea-card.suffering .sea-card-back { border-color: var(--sea-accent-suffering); }
.sea-card.suffering .reflection-box { border-left-color: var(--sea-accent-suffering); }
.sea-card.suffering .ai-message h5 { color: var(--sea-accent-suffering); }


/* Highlight Box */
.highlight-box {
    background: linear-gradient(135deg, #0288d1 0%, #26c6da 100%);
    color: white;
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 4rem 0;
    box-shadow: 0 10px 30px rgba(2, 136, 209, 0.3);
    position: relative;
    overflow: hidden;
}

.highlight-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Conclusion Box */
.conclusion-box {
    background: white;
    border: 3px solid var(--healing-secondary);
    padding: 3rem;
    border-radius: 30px;
    text-align: left; /* Changed from center to left */
    margin-top: 5rem;
    position: relative;
}

.conclusion-box p {
    font-size: 1.3rem;
    line-height: 2;
    color: var(--text-color);
    font-weight: 500;
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .content-body {
        padding: 1rem;
    }
    .sea-card-scene {
        height: 600px; /* Allow cards to be taller on mobile if text wraps */
    }
    h2 { font-size: 1.6rem; }
}
