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

:root {
    --ocean-deep: #0D47A1; /* Medical Lab Blue */
    --ocean-light: #1DE9B6; /* Turquoise Mint */
    --amber-gold: #FFCA28;
    --creamy-white: #ffffff;
    --wood-brown: #002171; /* Dark blue for contrast */
}

body {
    font-family: 'Baloo Bhaijaan 2', cursive;
    background-color: #E3F2FD; /* Medical Lab Blue bg */
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    color: var(--creamy-white);
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    padding: 2rem 1rem;
}

/* خلفية المختبر الطبي */
.lab-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -2;
    background: #E3F2FD;
    overflow: hidden;
}
.medical-icon-bg {
    position: absolute;
    font-size: 3rem;
    color: rgba(13, 71, 161, 0.08); 
    animation: floatIcon infinite linear;
    z-index: -1; 
}
@keyframes floatIcon {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-110vh) rotate(45deg); opacity: 0; }
}

/* تمت إزالة حركات الأسماك والفقاعات لتبديل الثيم */

.captain-avatar {
    position: absolute;
    top: 30px;
    right: 30px;
    font-size: 5rem;
    z-index: 10;
    animation: float 4s ease-in-out infinite;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.3));
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.container {
    background: rgba(13, 71, 161, 0.85); /* Medical dark blue */
    border: 6px solid var(--ocean-light);
    backdrop-filter: blur(10px);
    border-radius: 40px;
    padding: 3rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3), inset 0 0 25px rgba(29, 233, 182, 0.4);
    width: 90%;
    max-width: 700px;
    text-align: center;
    transition: all 0.4s ease;
    z-index: 10;
    position: relative;
    margin: auto;
}

/* Audio & Text wrappers */
.text-with-audio {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 0.5rem;
}
.subtitle-audio {
    margin-bottom: 2.5rem;
}

.title {
    font-size: 4rem;
    color: var(--amber-gold);
    font-weight: 800;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.6);
    margin: 0;
}

.subtitle {
    font-size: 1.8rem;
    color: var(--creamy-white);
    line-height: 1.6;
    font-weight: 700;
    margin: 0;
}

/* أزرار السماعة */
.speak-btn {
    background: var(--ocean-light);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    padding: 0;
}
.speak-btn:hover {
    transform: scale(1.1);
    background: var(--amber-gold);
}
.speak-btn:active {
    transform: scale(0.95);
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin-bottom: 1.5rem;
}

.input-audio-wrapper {
    position: relative;
    width: 85%;
}

input {
    width: 100%;
    padding: 20px 60px 20px 25px; /* مسافة إضافية للسماعة */
    font-size: 1.8rem;
    border: 6px solid var(--ocean-light);
    border-radius: 25px;
    outline: none;
    background: var(--creamy-white);
    color: var(--ocean-deep);
    transition: all 0.3s;
    font-family: 'Baloo Bhaijaan 2', cursive;
    text-align: center;
    font-weight: 800;
}
input:focus {
    border-color: var(--amber-gold);
    box-shadow: 0 0 20px rgba(250, 184, 0, 0.6);
}

.input-speak {
    position: absolute;
    left: 15px; /* RTL meaning left is inside the input end */
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
}
.input-speak:hover {
    transform: translateY(-50%) scale(1.1);
}

.helm-btn {
    background: var(--amber-gold);
    color: var(--ocean-deep);
    border: none;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    font-size: 2.2rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: 'Baloo Bhaijaan 2', cursive;
    border: 8px dashed var(--creamy-white);
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
}
.helm-btn-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.btn-speak {
    width: 35px;
    height: 35px;
    font-size: 1rem;
    background: rgba(255,255,255,0.4);
}
.btn-speak:hover {
    background: white;
}
.helm-btn:hover {
    transform: scale(1.1) rotate(15deg) translateY(-5px);
    box-shadow: 0 15px 35px rgba(250, 184, 0, 0.5);
    background: #FFCA28;
}
.helm-btn:active {
    transform: scale(0.95);
}

.error-message {
    color: #FF6B6B;
    font-weight: 800;
    font-size: 1.5rem;
    min-height: 40px;
    opacity: 0;
    transition: opacity 0.3s;
    background: rgba(0,0,0,0.3);
    padding: 10px 20px;
    border-radius: 15px;
    margin-top: 15px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.error-message.show {
    opacity: 1;
}

.hidden {
    display: none !important;
}

.cards-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.porthole-card {
    text-decoration: none;
    background: var(--wood-brown);
    border-radius: 50%;
    width: 180px;
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 12px 30px rgba(0,0,0,0.6), inset 0 0 15px rgba(0,0,0,0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 12px;
}

.porthole-card .glass {
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(0, 168, 150, 0.9) 100%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 5px solid #5C3A21;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--creamy-white);
    transition: all 0.4s ease;
}

.porthole-card:hover {
    transform: translateY(-20px) scale(1.05);
}
.porthole-card:hover .glass {
    background: linear-gradient(135deg, rgba(255,255,255,0.7) 0%, var(--amber-gold) 100%);
    color: var(--ocean-deep);
}

.icon {
    font-size: 3.5rem;
    text-shadow: 0 5px 10px rgba(0,0,0,0.3);
    transition: transform 0.3s;
}
.porthole-card:hover .icon {
    transform: scale(1.1);
}

.porthole-card h3 {
    font-size: 1.5rem;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin: 0;
}
.porthole-card:hover h3 {
    text-shadow: none;
}

.card-speak {
    width: 35px;
    height: 35px;
    font-size: 1rem;
    background: rgba(0,0,0,0.2);
}
.card-speak:hover {
    background: var(--amber-gold);
}
