/* ============================================
   Phone UI — Interactive Phone Overlay
   ============================================ */

/* Phone screen overlay — positioned over the animated phone */
.phone-overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 320px;
    height: 530px;
    z-index: 25;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
    overflow: hidden;
    border-radius: 14px;
    transform-origin: 0 0;
}

.phone-overlay.active {
    pointer-events: auto;
    opacity: 1;
}

/* Boot animation */
.phone-boot-screen {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0a0a14 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 30;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.phone-boot-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.phone-boot-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: phone-boot-pulse 1.2s ease-in-out infinite;
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.4);
}

.phone-boot-logo span {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
}

@keyframes phone-boot-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 30px rgba(102, 126, 234, 0.4); }
    50% { transform: scale(1.1); box-shadow: 0 0 50px rgba(102, 126, 234, 0.6); }
}

/* ============================================
   Home Screen
   ============================================ */
.phone-home {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, #0f0c29, #302b63 50%, #24243e);
    display: flex;
    flex-direction: column;
    padding: 8% 6% 6%;
    overflow: hidden;
}

.phone-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px 8px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    flex-shrink: 0;
}

.phone-status-bar .time {
    font-weight: 600;
    font-size: 11px;
}

.phone-status-icons {
    display: flex;
    gap: 4px;
    align-items: center;
    font-size: 9px;
}

.phone-app-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 8px;
    align-content: start;
    padding-top: 10%;
}

.phone-app-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.phone-app-icon:active {
    transform: scale(0.88);
}

.phone-app-icon .icon-box {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.15s ease;
}

.phone-app-icon:hover .icon-box {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.phone-app-icon .icon-label {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    text-align: center;
    line-height: 1.1;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* App icon colors */
.icon-gmail { background: linear-gradient(135deg, #EA4335, #DB4437); }
.icon-github { background: linear-gradient(135deg, #24292e, #40464d); }
.icon-linkedin { background: linear-gradient(135deg, #0077B5, #005582); }
.icon-camera { background: linear-gradient(135deg, #4CAF50, #2E7D32); }
.icon-album { background: linear-gradient(135deg, #FF9800, #F57C00); }
.icon-calculator { background: linear-gradient(135deg, #607D8B, #455A64); }
.icon-snake { background: linear-gradient(135deg, #8BC34A, #558B2F); }

/* Home dock bar */
.phone-dock {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 8px 0 4px;
    flex-shrink: 0;
}

.phone-dock-indicator {
    width: 36%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 6px auto 0;
}

/* ============================================
   App Screen Container
   ============================================ */
.phone-app-screen {
    position: absolute;
    inset: 0;
    z-index: 5;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
}

.phone-app-screen.visible {
    transform: translateX(0);
}

/* App top bar with back button */
.phone-app-topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex-shrink: 0;
    z-index: 2;
}

.phone-back-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    flex-shrink: 0;
}

.phone-back-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

.phone-app-title {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    flex: 1;
}

/* App content area */
.phone-app-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

/* Scrollbar styling for phone apps */
.phone-app-content::-webkit-scrollbar {
    width: 3px;
}

.phone-app-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}
