/* CorridorOS Mobile Apps Styles */
/* Comprehensive styling for mobile app interface */

/* Enhanced Mobile App Grid with Responsive Design */
.mobile-app-grid {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: var(--z-drawer);
    display: flex;
    flex-direction: column;
    transform: translateY(6%);
    transition: transform 0.25s ease, opacity 0.2s ease, visibility 0.2s ease;
    visibility: hidden;
    opacity: 0;
    padding: var(--mobile-grid-padding, 20px);
    padding-top: calc(env(safe-area-inset-top, 0px) + var(--mobile-grid-padding, 20px));
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--mobile-grid-padding, 20px));
    padding-left: calc(env(safe-area-inset-left, 0px) + var(--mobile-grid-padding, 20px));
    padding-right: calc(env(safe-area-inset-right, 0px) + var(--mobile-grid-padding, 20px));
    /* Hidden by default should not consume taps */
    pointer-events: none;
}

/* Responsive app grid layout */
.mobile-app-grid .app-grid {
    display: grid;
    /* Double-row horizontal flow with ample spacing */
    grid-template-columns: none; /* allow auto columns */
    grid-template-rows: repeat(2, 92px);
    grid-auto-flow: column;
    grid-auto-columns: 92px;
    gap: 16px 20px;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    align-content: start;
    min-height: 0;
    padding: 0 18px; /* generous side padding */
    scrollbar-width: none;
}
.mobile-app-grid .app-grid::-webkit-scrollbar { display: none; }

/* Screen size specific mobile grid adjustments */
.ultra-wide-mode .mobile-app-grid .app-grid {
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 24px;
}

.large-desktop-mode .mobile-app-grid .app-grid {
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 22px;
}

.desktop-mode .mobile-app-grid .app-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 20px;
}

.large-tablet-mode .mobile-app-grid .app-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 18px;
}

.tablet-mode .mobile-app-grid .app-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 16px;
}

.large-phone-mode .mobile-app-grid .app-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 14px;
}

.phone-mode .mobile-app-grid .app-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 12px;
}

.small-phone-mode .mobile-app-grid .app-grid {
    grid-template-columns: repeat(1, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 10px;
}

/* Orientation adjustments for mobile grid */
.landscape-mode .mobile-app-grid .app-grid {
    grid-template-columns: repeat(calc(var(--mobile-grid-columns, 2) + 1), 1fr);
    grid-template-rows: repeat(calc(var(--mobile-grid-rows, 6) - 1), 1fr);
}

.mobile-app-grid.visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-app-grid-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-app-grid-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: white;
    margin: 0;
}

.mobile-app-search-btn {
    width: 44px;
    height: 44px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-app-search-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.mobile-app-search {
    margin-bottom: 20px;
}

.mobile-search-input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    font-size: 16px;
    outline: none;
}

.mobile-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.mobile-app-categories {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-app-category {
    margin-bottom: 32px;
}

.mobile-app-category h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-cyan);
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 200, 255, 0.3);
}

.mobile-app-category-grid {
    display: grid;
    /* Double-row horizontal flow with ample spacing */
    grid-template-columns: none;
    grid-template-rows: repeat(2, 92px);
    grid-auto-flow: column;
    grid-auto-columns: 92px;
    gap: 16px 20px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 18px;
    scrollbar-width: none;
}
.mobile-app-category-grid::-webkit-scrollbar { display: none; }

.mobile-app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 10px; /* slimmer */
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 92px;
    min-width: 92px;
}

.mobile-app-item:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.2);
}

.mobile-app-icon {
    font-size: 24px; /* slimmer icons */
}

.mobile-app-name {
    font-size: 14px;
    font-weight: 500;
    color: white;
    text-align: center;
}

/* Mobile App Switcher */
.mobile-app-switcher-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: var(--z-drawer);
    display: flex;
    flex-direction: column;
    transform: translateY(6%);
    transition: transform 0.25s ease, opacity 0.2s ease, visibility 0.2s ease;
    /* Hidden by default should not consume taps */
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
}

.mobile-app-switcher-overlay.visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-app-switcher-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    padding-top: calc(env(safe-area-inset-top, 0px) + 20px);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
}

.mobile-app-switcher-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-app-switcher-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin: 0;
}

.mobile-app-switcher-close {
    width: 44px;
    height: 44px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-app-switcher-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.mobile-app-switcher-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-app-switcher-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-app-switcher-item.active {
    background: rgba(0, 200, 255, 0.3);
    border-color: rgba(0, 200, 255, 0.5);
}

.mobile-app-switcher-item:active {
    transform: scale(0.98);
}

.mobile-app-switcher-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.mobile-app-switcher-name {
    font-size: 16px;
    font-weight: 500;
    color: white;
    flex: 1;
}

.mobile-app-switcher-close {
    width: 32px;
    height: 32px;
    border-radius: 16px;
    background: rgba(255, 95, 86, 0.8);
    border: none;
    color: white;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-app-switcher-close:hover {
    background: rgba(255, 95, 86, 1);
    transform: scale(1.1);
}

.mobile-app-switcher-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-app-action-btn {
    flex: 1;
    padding: 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-app-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.02);
}

/* Mobile App Controls */
.mobile-app-controls {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-popover);
    display: none;
    width: min(92vw, 360px);
}

.mobile-app-active .mobile-app-controls {
    display: block;
}

.mobile-app-control-bar {
    /* Two-row vertical stack (2x2 grid) with generous spacing */
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 48px;
    gap: 16px 20px; /* row gap, column gap */
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 14px 18px; /* ample side padding */
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-sizing: border-box;
}

.mobile-app-control-btn {
    /* Slimmer buttons */
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-app-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.mobile-app-control-btn:active {
    transform: scale(0.95);
}

/* Mobile App Windows */
.mobile-app-window {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary);
    z-index: var(--z-drawer); /* Above desktop windows, below overlays */
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.mobile-app-window:last-child {
    transform: translateX(0);
}

.mobile-app-window-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.mobile-app-window-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.mobile-app-window-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.mobile-app-window-name {
    font-size: 18px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-app-window-controls {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.mobile-app-window-minimize,
.mobile-app-window-close {
    width: 36px;
    height: 36px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-app-window-minimize {
    background: rgba(255, 189, 46, 0.8);
    border: 1px solid rgba(255, 189, 46, 0.3);
}

.mobile-app-window-close {
    background: rgba(255, 95, 86, 0.8);
    border: 1px solid rgba(255, 95, 86, 0.3);
}

.mobile-app-window-minimize:hover,
.mobile-app-window-close:hover {
    transform: scale(1.1);
}

.mobile-app-window-content {
    flex: 1;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
}

/* Mobile Home App */
.mobile-home-app {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.mobile-home-welcome {
    text-align: center;
    padding: 20px 0;
}

.mobile-home-welcome h1 {
    font-size: 32px;
    font-weight: 700;
    color: white;
    margin: 0 0 12px 0;
}

.mobile-home-welcome p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.mobile-home-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.mobile-home-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-home-action:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.2);
}

.action-icon {
    font-size: 32px;
}

.action-label {
    font-size: 14px;
    font-weight: 500;
    color: white;
}

.mobile-home-recent h3 {
    font-size: 20px;
    font-weight: 600;
    color: white;
    margin: 0 0 16px 0;
}

.mobile-home-recent-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-home-recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-home-recent-item:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.2);
}

.recent-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.recent-name {
    font-size: 16px;
    font-weight: 500;
    color: white;
}

/* Mobile Settings App */
.mobile-settings-app {
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-settings-section {
    margin-bottom: 32px;
}

.mobile-settings-section h3 {
    font-size: 20px;
    font-weight: 600;
    color: white;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-settings-item:last-child {
    border-bottom: none;
}

.mobile-settings-item label {
    font-size: 16px;
    font-weight: 500;
    color: white;
}

.mobile-settings-item select,
.mobile-settings-item input[type="range"] {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    padding: 8px 12px;
}

.mobile-settings-item span {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

/* Mobile Terminal App */
.mobile-terminal-app {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #1e1e1e;
    color: #00ff00;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.mobile-terminal-output {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    line-height: 1.4;
}

.mobile-terminal-input {
    padding: 16px;
    border-top: 1px solid #444;
    background: #2d2d2d;
}

.mobile-terminal-cmd {
    width: 100%;
    background: transparent;
    border: none;
    color: #00ff00;
    font-family: inherit;
    font-size: 16px;
    outline: none;
    padding: 8px 0;
}

.mobile-terminal-cmd::placeholder {
    color: rgba(0, 255, 0, 0.5);
}

.terminal-line {
    margin-bottom: 4px;
    word-wrap: break-word;
}

.terminal-prompt {
    color: #00d4ff;
    font-weight: bold;
}

.terminal-text {
    color: #00ff00;
}

/* Mobile Files App */
.mobile-files-app {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mobile-files-toolbar {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-files-btn {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-files-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mobile-files-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-files-list {
    padding: 16px;
}

.mobile-files-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    margin-bottom: 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-files-item:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.2);
}

.file-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.file-name {
    font-size: 16px;
    font-weight: 500;
    color: white;
}

/* Mobile Calculator App */
.mobile-calculator-app {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #000;
    color: white;
}

.mobile-calculator-display {
    padding: 20px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
}

.mobile-calculator-screen {
    width: 100%;
    background: transparent;
    border: none;
    color: white;
    font-size: 32px;
    font-weight: 300;
    text-align: right;
    outline: none;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
}

.mobile-calculator-buttons {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: #333;
}

.calc-btn {
    background: #2a2a2a;
    border: none;
    color: white;
    font-size: 24px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.1s ease;
    min-height: 60px;
}

.calc-btn:active {
    background: #3a3a3a;
    transform: scale(0.95);
}

.calc-btn.number {
    background: #1a1a1a;
}

.calc-btn.operator {
    background: #ff9500;
}

.calc-btn.equals {
    background: #ff9500;
    grid-row: span 2;
}

.calc-btn.clear {
    background: #a6a6a6;
    color: #000;
}

.calc-btn.zero {
    grid-column: span 2;
}

/* Mobile Notes App */
.mobile-notes-app {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mobile-notes-toolbar {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-notes-btn {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-notes-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mobile-notes-content {
    flex: 1;
    padding: 16px;
}

.mobile-notes-editor {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    color: white;
    font-size: 16px;
    line-height: 1.6;
    outline: none;
    resize: none;
    font-family: inherit;
}

.mobile-notes-editor::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Mobile Browser App */
.mobile-browser-app {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mobile-browser-toolbar {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-browser-url {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 16px;
    outline: none;
}

.mobile-browser-url::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.mobile-browser-go {
    padding: 12px 20px;
    background: var(--primary-cyan);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-browser-go:hover {
    background: #00a2ff;
}

.mobile-browser-content {
    flex: 1;
    overflow: hidden;
}

.mobile-browser-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

/* Mobile Quantum Lab App */
.mobile-quantum-lab-app {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mobile-quantum-header {
    text-align: center;
    padding: 20px 0;
}

.mobile-quantum-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin: 0 0 8px 0;
}

.mobile-quantum-header p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.mobile-quantum-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.mobile-quantum-btn {
    padding: 16px 24px;
    background: rgba(0, 200, 255, 0.2);
    border: 1px solid rgba(0, 200, 255, 0.4);
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-quantum-btn:hover {
    background: rgba(0, 200, 255, 0.3);
    transform: scale(1.05);
}

.mobile-quantum-output {
    flex: 1;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.quantum-status {
    font-size: 16px;
    color: #00ff00;
    text-align: center;
    padding: 20px;
}

/* Mobile Photonic Studio App */
.mobile-photonic-studio-app {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mobile-photonic-header {
    text-align: center;
    padding: 20px 0;
}

.mobile-photonic-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin: 0 0 8px 0;
}

.mobile-photonic-header p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.mobile-photonic-canvas {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-photonic-canvas canvas {
    border-radius: 8px;
    background: #1a1a1a;
}

.mobile-photonic-tools {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.mobile-photonic-tool {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-photonic-tool.active {
    background: rgba(0, 200, 255, 0.3);
    border-color: rgba(0, 200, 255, 0.5);
}

.mobile-photonic-tool:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Mobile Music App */
.mobile-music-app {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 20px;
}

.mobile-music-player {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.music-album-art {
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    margin: 0 auto 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.music-info h4 {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin: 0 0 8px 0;
}

.music-info p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 24px 0;
}

.music-controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 24px;
}

.music-btn {
    width: 56px;
    height: 56px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.music-btn.play {
    background: var(--primary-cyan);
    border-color: var(--primary-cyan);
    width: 72px;
    height: 72px;
    border-radius: 36px;
    font-size: 32px;
}

.music-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.music-btn.play:hover {
    background: #00a2ff;
}

.music-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.music-progress-bar {
    width: 30%;
    height: 100%;
    background: var(--primary-cyan);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Mobile Gallery App */
.mobile-gallery-app {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mobile-gallery-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-gallery-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin: 0;
}

.mobile-gallery-grid {
    flex: 1;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-gallery-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-gallery-item:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.2);
}

.gallery-placeholder {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.gallery-name {
    font-size: 14px;
    font-weight: 500;
    color: white;
    text-align: center;
}

/* Mobile Camera App */
.mobile-camera-app {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mobile-camera-viewfinder {
    flex: 1;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-placeholder {
    text-align: center;
    color: white;
}

.camera-placeholder .camera-icon {
    font-size: 80px;
    display: block;
    margin-bottom: 16px;
}

.camera-placeholder p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.mobile-camera-controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.mobile-camera-btn {
    width: 64px;
    height: 64px;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-camera-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 480px) {
    .mobile-app-category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mobile-home-quick-actions {
        grid-template-columns: 1fr;
    }
    
    .mobile-calculator-buttons {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .mobile-gallery-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
    .mobile-app-category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .mobile-home-quick-actions {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .mobile-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Dark Mode Optimizations */
@media (prefers-color-scheme: dark) {
    .mobile-app-window-content {
        background: #1a1a1a;
    }
    
    .mobile-terminal-app {
        background: #0d1117;
    }
    
    .mobile-calculator-app {
        background: #000;
    }
}

/* Light Mode Optimizations */
@media (prefers-color-scheme: light) {
    .mobile-app-grid,
    .mobile-app-switcher-overlay {
        background: rgba(255, 255, 255, 0.95);
    }
    
    .mobile-app-grid-header h2,
    .mobile-app-switcher-header h3 {
        color: #000;
    }
    
    .mobile-app-item,
    .mobile-app-switcher-item {
        background: rgba(0, 0, 0, 0.1);
        border-color: rgba(0, 0, 0, 0.2);
    }
    
    .mobile-app-name,
    .mobile-app-switcher-name {
        color: #000;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    .mobile-app-grid,
    .mobile-app-switcher-overlay,
    .mobile-app-window {
        transition: none;
    }
    
    .mobile-app-item,
    .mobile-app-switcher-item,
    .mobile-home-action {
        transition: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .mobile-app-item,
    .mobile-app-switcher-item,
    .mobile-home-action {
        border: 2px solid rgba(255, 255, 255, 0.8);
    }
    
    .mobile-app-control-btn {
        border: 2px solid rgba(255, 255, 255, 0.8);
    }
}

/* Ecosystem Apps Styling */
.mobile-ecosystem-app {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, rgba(8,145,178,.12), rgba(13,148,136,.08));
    color: white;
    padding: 20px;
    overflow-y: auto;
}

.ecosystem-app-header {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.ecosystem-app-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: white;
}

.ecosystem-app-header p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.ecosystem-app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.carbon-stats,
.genomics-stats,
.ocean-stats,
.factory-stats,
.medimage-stats,
.agri-stats,
.traffic-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--teal, #26c6da);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    line-height: 1.3;
}

.scheduler-controls,
.genomics-controls,
.ocean-controls,
.factory-controls,
.medimage-controls,
.agri-controls,
.traffic-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ecosystem-btn {
    padding: 16px 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.ecosystem-btn.primary {
    background: linear-gradient(135deg, var(--teal, #26c6da), var(--cyan, #4fc3f7));
    border: none;
    color: white;
    box-shadow: 0 4px 16px rgba(38, 198, 218, 0.3);
}

.ecosystem-btn:active {
    transform: scale(0.98);
}

.ecosystem-btn.primary:active {
    box-shadow: 0 2px 8px rgba(38, 198, 218, 0.4);
}

/* Dark mode ecosystem apps */
@media (prefers-color-scheme: dark) {
    .mobile-ecosystem-app {
        background: linear-gradient(135deg, rgba(15,15,35,.9), rgba(26,26,46,.8));
    }
    
    .stat-item {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.15);
    }
    
    .ecosystem-btn {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
    }
}

/* Mobile ecosystem app responsive design */
@media (max-width: 480px) {
    .carbon-stats,
    .genomics-stats,
    .ocean-stats,
    .factory-stats,
    .medimage-stats,
    .agri-stats,
    .traffic-stats {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .ecosystem-app-header h2 {
        font-size: 24px;
    }
    
    .stat-value {
        font-size: 20px;
    }
}
