/* ============================================ */
/* Shared Phase Overlay Base                    */
/* ============================================ */
.phase-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0a0a0a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.phase-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Phase Titles */
.phase-title {
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
    letter-spacing: 0.5px;
}

.phase-subtitle {
    color: #4cc9f0;
    font-size: 16px;
    margin-bottom: 35px;
    text-align: center;
    opacity: 0.9;
}

/* Phase Status Text */
.phase-status {
    color: #4cc9f0;
    font-size: 14px;
    text-align: center;
    margin-top: 5px;
}

/* Phase Progress Box (shared by all 3 phases) */
.phase-progress-box {
    width: 280px;
    max-width: 90%;
    background-color: rgba(20, 20, 30, 0.8);
    border: 1px solid rgba(76, 201, 240, 0.3);
    border-radius: 8px;
    padding: 14px 18px;
    margin-top: 15px;
}

.phase-progress-label {
    color: #d8d8d8;
    font-size: 13px;
    text-align: center;
    margin-bottom: 10px;
}

.progress-container {
    width: 100%;
    height: 6px;
    background-color: #2a2a3a;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: #4cc9f0;
    border-radius: 3px;
}

/* Dots Container (shared) */
.dots-container {
    display: flex;
    justify-content: center;
    margin: 25px 0;
}

.dot {
    width: 10px;
    height: 10px;
    margin: 0 6px;
    border-radius: 50%;
    background-color: #555;
    animation: pulseDot 1.5s ease-in-out infinite;
}

.dot:nth-child(1) { animation-delay: 0s; }
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }


/* ============================================ */
/* PHASE 1: Verifying Phone Number              */
/* ============================================ */
.phone-icon {
    width: 70px;
    height: 110px;
    border: 3px solid #4cc9f0;
    border-radius: 12px;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
    background: rgba(76, 201, 240, 0.05);
}

.phone-screen {
    position: absolute;
    top: 10px;
    left: 6px;
    right: 6px;
    bottom: 28px;
    background-color: rgba(76, 201, 240, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.scan-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #4cc9f0;
    box-shadow: 0 0 12px rgba(76, 201, 240, 0.9);
    animation: scanMove 2s ease-in-out infinite;
}

.phone-led {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background-color: #27c93f;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(39, 201, 63, 0.6);
    animation: ledBlink 2s ease-in-out infinite;
}


/* ============================================ */
/* PHASE 2: Terminal / Coordinate System        */
/* ============================================ */
.terminal-container {
    width: 90%;
    max-width: 480px;
    height: 280px;
    background-color: #1a1a1a;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.6),
        0 0 1px rgba(76, 201, 240, 0.3);
    margin-bottom: 10px;
    position: relative;
}

.terminal-header-bar {
    background-color: #2d2d2d;
    height: 30px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-bottom: 1px solid #3a3a3a;
}

.terminal-buttons {
    display: flex;
    align-items: center;
}

.terminal-button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.close-btn { background-color: #ff5f56; }
.minimize-btn { background-color: #ffbd2e; }
.maximize-btn { background-color: #27c93f; }

.terminal-title-text {
    color: #888;
    font-size: 12px;
    margin-left: 12px;
    font-family: 'Courier New', monospace;
}

.terminal-content {
    padding: 15px;
    height: calc(100% - 30px);
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    color: #d8d8d8;
    font-size: 13px;
    line-height: 1.7;
}

/* Terminal Text Styles */
.terminal-content .prompt {
    color: #87d441;
}

.terminal-content .command {
    color: #ffffff;
    font-weight: bold;
}

.terminal-content .response {
    color: #d8d8d8;
}

.terminal-content .highlight {
    color: #4cc9f0;
    font-weight: bold;
}

.terminal-content .t-success {
    color: #27c93f;
}

.terminal-content .t-warning {
    color: #ffbd2e;
}

.terminal-content .t-error {
    color: #ff5f56;
}

/* Blinking Cursor in Terminal */
.cursor {
    display: inline-block;
    width: 8px;
    height: 14px;
    background-color: #87d441;
    margin-left: 3px;
    animation: blink 1s step-end infinite;
    vertical-align: middle;
}


/* ============================================ */
/* PHASE 3: Satellite Positioning               */
/* ============================================ */
.satellite-container {
    position: relative;
    width: 240px;
    height: 240px;
    margin-bottom: 25px;
}

/* Earth Globe */
.earth {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, 
        #67d8ef 0%, 
        #4cc9f0 20%, 
        #3498db 45%, 
        #2980b9 65%, 
        #1e3a8a 100%);
    box-shadow: 
        0 0 40px rgba(76, 201, 240, 0.3),
        0 0 80px rgba(76, 201, 240, 0.1);
    overflow: hidden;
}

.earth::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 55% 75%, rgba(255,255,255,0.15) 4%, transparent 7%),
        radial-gradient(circle at 75% 55%, rgba(255,255,255,0.12) 4%, transparent 7%),
        radial-gradient(circle at 65% 25%, rgba(255,255,255,0.1) 4%, transparent 7%),
        radial-gradient(circle at 35% 35%, rgba(255,255,255,0.12) 4%, transparent 7%),
        radial-gradient(circle at 25% 60%, rgba(255,255,255,0.08) 4%, transparent 7%);
}

/* Dashed orbit rings */
.satellite-container .orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px dashed rgba(76, 201, 240, 0.25);
}

.satellite-container .orbit:nth-child(1) { width: 170px; height: 170px; }
.satellite-container .orbit:nth-child(2) { width: 200px; height: 200px; }
.satellite-container .orbit:nth-child(3) { width: 230px; height: 230px; }

/* Satellite sparkles (purple ✦) */
.sat {
    position: absolute;
    font-size: 20px;
    color: #b44dff;
    text-shadow: 0 0 10px rgba(180, 77, 255, 0.8);
    z-index: 5;
}

.sat-1 {
    top: 50%;
    left: 50%;
    animation: satOrbit1 8s linear infinite;
}

.sat-2 {
    top: 50%;
    left: 50%;
    animation: satOrbit2 12s linear infinite;
}

.sat-3 {
    top: 50%;
    left: 50%;
    animation: satOrbit3 10s linear infinite;
}

/* Signal waves from target on earth */
.signal-wave {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(76, 201, 240, 0.6);
    opacity: 0;
    transform: translate(-50%, -50%);
    animation: signalPulse 2s infinite;
}

.target-location {
    position: absolute;
    top: 55%;
    left: 48%;
    width: 0;
    height: 0;
    z-index: 6;
}

/* Coordinates Data Box */
.coords-data-box {
    width: 280px;
    max-width: 90%;
    background-color: rgba(10, 15, 25, 0.9);
    border: 1px solid rgba(76, 201, 240, 0.4);
    border-radius: 8px;
    padding: 0;
    font-family: 'Courier New', monospace;
    margin-bottom: 20px;
    overflow: hidden;
}

.coords-header {
    background: linear-gradient(90deg, rgba(76, 201, 240, 0.2), transparent);
    color: #4cc9f0;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(76, 201, 240, 0.3);
    letter-spacing: 1px;
}

.coords-row {
    display: flex;
    justify-content: space-between;
    padding: 7px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.coords-row:last-child {
    border-bottom: none;
}

.coords-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.coords-value {
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
}

.coords-status {
    color: #4cc9f0;
}


/* ============================================ */
/* Keyframe Animations                          */
/* ============================================ */
@keyframes scanMove {
    0%, 100% { top: 5%; opacity: 0; }
    10%, 90% { opacity: 1; }
    50% { top: 85%; }
}

@keyframes pulseDot {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.1); }
}

@keyframes ledBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes signalPulse {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
}

@keyframes satOrbit1 {
    0% { transform: rotate(0deg) translateX(85px) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(85px) rotate(-360deg); }
}

@keyframes satOrbit2 {
    0% { transform: rotate(120deg) translateX(100px) rotate(-120deg); }
    100% { transform: rotate(480deg) translateX(100px) rotate(-480deg); }
}

@keyframes satOrbit3 {
    0% { transform: rotate(240deg) translateX(92px) rotate(-240deg); }
    100% { transform: rotate(600deg) translateX(92px) rotate(-600deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ============================================ */
/* Responsive Design                            */
/* ============================================ */
@media (max-width: 768px) {
    .phase-title {
        font-size: 22px;
    }
    .phase-subtitle {
        font-size: 14px;
        margin-bottom: 25px;
    }
    .terminal-container {
        height: 260px;
    }
    .terminal-header-bar {
        height: 26px;
    }
    .terminal-button {
        width: 10px;
        height: 10px;
        margin-right: 6px;
    }
    .terminal-title-text {
        font-size: 10px;
    }
    .satellite-container {
        width: 200px;
        height: 200px;
    }
    .earth {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .phase-title {
        font-size: 20px;
    }
    .phase-subtitle {
        font-size: 13px;
        margin-bottom: 20px;
    }
    .terminal-container {
        height: 240px;
    }
    .terminal-content {
        font-size: 11px;
        padding: 10px;
    }
    .satellite-container {
        width: 180px;
        height: 180px;
    }
    .earth {
        width: 85px;
        height: 85px;
    }
    .phone-icon {
        width: 58px;
        height: 92px;
    }
    .coords-data-box {
        width: 90%;
    }
    .phase-progress-box {
        width: 90%;
    }
}

@media (max-width: 320px) {
    .terminal-container {
        height: 220px;
    }
    .terminal-content {
        font-size: 10px;
        padding: 8px;
    }
}