/* 
 * Phone English - iPhone Style Phone UI
 * 아이폰 전화 스타일의 모바일 퍼스트 디자인
 */

:root {
    /* Colors - iOS Dark Mode */
    --bg-primary: #000000;
    --bg-secondary: #1c1c1e;
    --bg-tertiary: #2c2c2e;
    --text-primary: #ffffff;
    --text-secondary: #8e8e93;
    --text-tertiary: #636366;
    --accent-green: #34c759;
    --accent-red: #ff3b30;
    --accent-blue: #007aff;
    --accent-orange: #ff9500;
    
    /* Gradients */
    --gradient-call: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --gradient-avatar: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* Shadows */
    --shadow-glow: 0 0 40px rgba(102, 126, 234, 0.4);
    --shadow-button: 0 4px 15px rgba(0, 0, 0, 0.3);
    
    /* Sizes */
    --safe-area-top: env(safe-area-inset-top, 20px);
    --safe-area-bottom: env(safe-area-inset-bottom, 20px);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Phone Container */
.phone-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-width: 430px;
    margin: 0 auto;
    background: var(--gradient-call);
    position: relative;
    overflow: hidden;
}

/* Status Bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(var(--safe-area-top) + 8px) 20px 8px;
    font-size: 14px;
    font-weight: 600;
}

.status-bar .time {
    min-width: 50px;
}

.status-bar .carrier {
    font-size: 12px;
    color: var(--text-secondary);
}

.status-icons {
    display: flex;
    gap: 4px;
    font-size: 12px;
}

/* Call Screen */
.call-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    overflow: hidden;
}

/* Caller Info */
.caller-info {
    text-align: center;
    margin-top: 20px;
}

.avatar {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
}

.avatar-glow {
    position: absolute;
    inset: -10px;
    background: var(--gradient-avatar);
    border-radius: 50%;
    opacity: 0.5;
    filter: blur(20px);
    animation: pulse-glow 2s ease-in-out infinite;
}

.avatar-icon {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--gradient-avatar);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    box-shadow: var(--shadow-glow);
}

@keyframes pulse-glow {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.7; }
}

.caller-name {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.call-status {
    font-size: 16px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.call-status.active {
    color: var(--accent-green);
}

/* Call Timer */
.call-timer {
    margin: 20px 0;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.call-timer.visible {
    opacity: 1;
    transform: translateY(0);
}

.timer-display {
    font-size: 22px;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
}

/* Waveform */
.waveform-container {
    margin: 20px 0;
    text-align: center;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.waveform-container.visible {
    opacity: 1;
    transform: scale(1);
}

.waveform {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 60px;
}

.wave-bar {
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--accent-blue) 0%, var(--accent-green) 100%);
    border-radius: 2px;
    animation: wave 0.5s ease-in-out infinite;
    animation-play-state: paused;
}

.waveform-container.active .wave-bar {
    animation-play-state: running;
}

.wave-bar:nth-child(1) { animation-delay: 0s; }
.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; }
.wave-bar:nth-child(5) { animation-delay: 0.4s; }
.wave-bar:nth-child(6) { animation-delay: 0.3s; }
.wave-bar:nth-child(7) { animation-delay: 0.2s; }
.wave-bar:nth-child(8) { animation-delay: 0.1s; }
.wave-bar:nth-child(9) { animation-delay: 0s; }

@keyframes wave {
    0%, 100% { height: 20px; }
    50% { height: 50px; }
}

.speaking-label {
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Transcript Container */
.transcript-container {
    flex: 1;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    margin: 10px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.transcript-container.visible {
    display: block;
}

.transcript-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transcript-item {
    padding: 12px 16px;
    border-radius: 16px;
    max-width: 85%;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.transcript-item.user {
    background: var(--accent-blue);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.transcript-item.assistant {
    background: var(--bg-tertiary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.transcript-item .role {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.7;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.transcript-item .text {
    font-size: 14px;
    line-height: 1.4;
}

/* Call Controls */
.call-controls {
    padding: 20px 30px calc(var(--safe-area-bottom) + 20px);
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.5) 100%);
}

.control-row {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
}

.control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 16px;
    padding: 16px 24px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.control-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.control-btn:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.control-btn:not(:disabled):active {
    transform: scale(0.95);
}

.control-btn.active {
    background: var(--accent-blue);
}

.control-btn .btn-icon {
    font-size: 24px;
}

.control-btn .btn-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.control-btn.active .btn-label {
    color: var(--text-primary);
}

/* Main Call Button */
.main-control {
    display: flex;
    justify-content: center;
}

.call-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-button);
}

.call-btn.start-call {
    background: var(--accent-green);
}

.call-btn.end-call {
    background: var(--accent-red);
}

.call-btn:hover {
    transform: scale(1.1);
}

.call-btn:active {
    transform: scale(0.95);
}

.call-btn.hidden {
    display: none;
}

/* Connecting Animation */
.connecting .avatar-glow {
    animation: connecting-pulse 0.8s ease-in-out infinite;
}

@keyframes connecting-pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
}

/* Responsive */
@media (min-width: 430px) {
    .phone-container {
        border-radius: 40px;
        margin: 20px auto;
        height: calc(100vh - 40px);
        box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    }
}

/* Dark mode scrollbar */
.transcript-container::-webkit-scrollbar {
    width: 4px;
}

.transcript-container::-webkit-scrollbar-track {
    background: transparent;
}

.transcript-container::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 2px;
}
