:root {
    --phone-width: 360px;
    --phone-height: 740px;
    --bezel-color: #1a1a1a;
    --screen-bg: url('../images/wallpaper.jpg') no-repeat center center/cover;
    --app-icon-size: 60px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    margin: 0;
    overflow: hidden;
    /* Prevent scrolling body behind phone */
}

/* Phone Frame - SIMPLIFIED (Screen Only) */
.phone-wrapper {
    position: relative;
    width: 100%;
    max-width: 480px;
    /* Max width for desktop view to keep phone-like aspect */
    height: 100vh;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    z-index: 1;
    margin: 0 auto;
    /* Center on desktop */
}

.phone-frame {
    width: 100%;
    height: 100%;
    position: relative;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: #222;
    background: var(--phone-wallpaper);
    background-size: cover;
    background-position: center;
    border-radius: 30px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Status Bar */
.status-bar {
    height: 40px;
    /* Slightly taller for modern look */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    color: white;
    font-size: 14px;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent);
}

/* Hide Notch and Buttons */
.notch,
.button-power,
.button-volume-up,
.button-volume-down {
    display: none;
}

/* Main Content Area */
.screen-content {
    flex: 1;
    /* Pushes nav-bar to bottom */
    position: relative;
    overflow: hidden;
    /* Hide overflow from apps */
    width: 100%;
}

/* Hide scrollbar */
.screen-content::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

/* Home Screen */
.home-screen {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 20px 10px;
    padding: 40px 10px;
    padding-top: 60px;
    /* Space for clock widget? */
    padding-bottom: 120px;
    /* Space for Dock */
}

.dock-bar {
    position: sticky;
    bottom: 10px;
    left: 5%;
    width: 90%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 15px 10px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 50;
    margin-top: auto;
    /* Push to bottom if absolute */
}

/* Ensure screen content handles absolute dock if needed */
.screen-content {
    flex: 1;
    overflow-y: auto;
    position: relative;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
}

.app-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.1s;
}

.app-icon:active {
    transform: scale(0.9);
}

.icon-box {
    width: var(--app-icon-size);
    height: var(--app-icon-size);
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    color: white;
    margin-bottom: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Dark Mode Variables */
body.dark-mode {
    --text-color: #f0f0f0;
    --text-muted: #aaaaaa;
    --app-bg-color: #1c1c1e;
    --card-bg: #2c2c2e;
    --border-color: #38383a;
}

body.dark-mode .app-body {
    background: var(--app-bg-color) !important;
    color: var(--text-color);
}

body.dark-mode .app-header {
    background: rgba(30, 30, 30, 0.85);
    border-bottom: 1px solid var(--border-color);
}

body.dark-mode .app-header span,
body.dark-mode .app-header i {
    color: var(--text-color) !important;
}

body.dark-mode .list-item {
    background: var(--card-bg);
}

body.dark-mode h2,
body.dark-mode h3,
body.dark-mode p {
    color: var(--text-color) !important;
}

/* Settings App Specific Dark Mode Overrides */
body.dark-mode .font-btn {
    color: var(--text-color);
}

body.dark-mode .font-btn.active {
    background: #444;
    color: white;
}

/* Font Size Modifiers */
.font-small {
    font-size: 14px;
}

.font-small h2 {
    font-size: 18px;
}

.font-small h3 {
    font-size: 16px;
}

.font-medium {
    font-size: 16px;
}

/* Default */

.font-large {
    font-size: 18px;
}

.font-large h2 {
    font-size: 26px;
}

.font-large h3 {
    font-size: 20px;
}

.font-large p {
    line-height: 1.6;
}

.icon-label {
    color: white;
    font-size: 11px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* App Styles */
/* App View Container */
.app-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--app-bg);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.app-header {
    height: 50px;
    background: #f8f8f8;
    /* Default light header */
    display: flex;
    align-items: center;
    padding: 0 15px;
    border-bottom: 1px solid #ddd;
    font-weight: 600;
}

.app-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

/* Navigation Bar */
.nav-bar {
    height: 50px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: transparent;
    /* Transparent on home */
    z-index: 20;
    padding-bottom: 5px;
}

.phone-screen.in-app .nav-bar {
    background: #fff;
    /* Solid on apps if needed, or keep transparent overlay */
    border-top: 1px solid #eee;
}

.nav-btn {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.nav-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

/* Buttons (Physical) - HIDDEN via display:none in .notch rule above, but keeping cleaner code */
.button-power,
.button-volume-up,
.button-volume-down {
    display: none;
}

/* Animations */
@keyframes openApp {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Media Queries for Mobile Use */
@media screen and (max-width: 480px) {
    .phone-wrapper {
        width: 100%;
        height: 100vh;
        border-radius: 0;
        padding: 0;
    }

    .phone-screen {
        border-radius: 0;
    }

    .status-bar .right-icons,
    .status-bar .left-icons {
        margin-top: 5px;
    }
}