/* === File Manager === */
.app-file-manager {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.fm-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.15);
}

.fm-toolbar-nav,
.fm-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.fm-toolbar button {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);
}

.fm-toolbar button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.fm-toolbar button .material-icons-round {
    font-size: 18px;
}

.fm-path {
    flex: 1;
    padding: 4px 10px;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
}

.fm-breadcrumb {
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all var(--transition);
}

.fm-breadcrumb:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.fm-breadcrumb .material-icons-round {
    font-size: 16px;
    vertical-align: middle;
}

.fm-search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 2px 10px;
    margin-right: 8px;
    transition: all var(--transition);
}

.fm-search-box:focus-within {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.fm-search-box .material-icons-round {
    font-size: 16px;
    color: var(--text-muted);
}

.fm-search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 4px 6px;
    font-size: 12px;
    font-family: inherit;
    outline: none;
    width: 120px;
}

.ctx-delete {
    color: #ff5f57 !important;
}

.ctx-delete .material-icons-round {
    color: #ff5f57 !important;
}

.fm-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.fm-sidebar {
    width: 170px;
    border-right: 1px solid var(--border);
    padding: 8px;
    overflow-y: auto;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.1);
}

.fm-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition);
    color: var(--text-secondary);
}

.fm-nav-item:hover {
    background: var(--bg-hover);
}

.fm-nav-item.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.fm-nav-item .material-icons-round {
    font-size: 18px;
}

.fm-content {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
    align-content: start;
}

.fm-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 4px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
    gap: 6px;
}

.fm-item:hover {
    background: var(--bg-hover);
}

.fm-item .material-icons-round {
    font-size: 36px;
}

.fm-item.folder .material-icons-round {
    color: #fdcb6e;
}

.fm-item.file .material-icons-round {
    color: var(--text-secondary);
}

.fm-item-name {
    font-size: 11px;
    text-align: center;
    color: var(--text-primary);
    word-break: break-word;
    line-height: 1.3;
}

/* === Terminal === */
.app-terminal {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #0d0d0d;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 13px;
    padding: 0;
}

.term-output {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    line-height: 1.6;
}

.term-line {
    white-space: pre-wrap;
    word-break: break-all;
}

.term-green {
    color: #00b894;
}

.term-blue {
    color: #74b9ff;
}

.term-yellow {
    color: #fdcb6e;
}

.term-red {
    color: #ff6b6b;
}

.term-cyan {
    color: #81ecec;
}

.term-input-line {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.3);
}

.term-prompt {
    color: var(--text-primary);
    white-space: nowrap;
    font-size: 13px;
}

.term-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    caret-color: var(--accent);
}

/* === Text Editor === */
.app-text-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.te-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.15);
}

.te-toolbar button {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);
}

.te-toolbar button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.te-toolbar button .material-icons-round {
    font-size: 18px;
}

.te-separator {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 4px;
}

.te-filename {
    flex: 1;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 0 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.te-wordcount {
    font-size: 11px;
    color: var(--text-muted);
}

.te-area {
    flex: 1;
    width: 100%;
    padding: 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    outline: none;
    tab-size: 4;
}

.te-area::placeholder {
    color: var(--text-muted);
}

/* === Browser === */
.app-browser {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.br-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.15);
}

.br-toolbar button {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);
}

.br-toolbar button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.br-toolbar button .material-icons-round {
    font-size: 18px;
}

.br-url {
    flex: 1;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 12px;
    outline: none;
    transition: border-color var(--transition);
}

.br-url:focus {
    border-color: var(--accent);
}

.br-frame {
    flex: 1;
    border: none;
    background: #fff;
}

/* === Calculator === */
.app-calculator {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
}

.calc-display {
    padding: 20px 20px 16px;
    text-align: right;
}

.calc-expression {
    font-size: 14px;
    color: var(--text-muted);
    min-height: 20px;
    margin-bottom: 4px;
}

.calc-result {
    font-size: 36px;
    font-weight: 300;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
}

.calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    padding: 2px;
    flex: 1;
}

.calc-btn {
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 18px;
    font-weight: 400;
    cursor: pointer;
    transition: background var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.calc-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.calc-btn:active {
    background: rgba(255, 255, 255, 0.18);
}

.calc-btn.func {
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent);
}

.calc-btn.func:hover {
    background: rgba(255, 255, 255, 0.14);
}

.calc-btn.op {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}

.calc-btn.op:hover {
    background: #7c6df7;
}

.calc-btn.zero {
    grid-column: span 2;
}

.calc-btn.eq {
    background: var(--accent);
}

/* === Settings === */
.app-settings {
    display: flex;
    height: 100%;
}

.set-sidebar {
    width: 190px;
    border-right: 1px solid var(--border);
    padding: 8px;
    background: rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.set-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background var(--transition), color var(--transition);
}

.set-nav:hover {
    background: var(--bg-hover);
}

.set-nav.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.set-nav .material-icons-round {
    font-size: 20px;
}

.set-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.set-panel h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.set-panel.hidden {
    display: none;
}

.set-group {
    margin-bottom: 24px;
}

.set-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.set-colors {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.set-color {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color var(--transition), transform var(--transition);
}

.set-color:hover {
    transform: scale(1.1);
}

.set-color.active {
    border-color: #fff;
}

.set-wallpapers {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.set-wp {
    width: 100px;
    height: 65px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color var(--transition), transform var(--transition);
}

.set-wp:hover {
    transform: scale(1.05);
}

.set-wp.active {
    border-color: var(--accent);
}

.set-group input[type="range"] {
    width: 200px;
    accent-color: var(--accent);
}

#set-scale-val {
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: 8px;
}

.set-input-text {
    width: 100%;
    max-width: 450px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition), background var(--transition);
}

.set-input-text:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.set-hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.set-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    max-width: 450px;
}

.set-btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

.set-btn-primary:hover {
    background: var(--accent-glow);
    transform: translateY(-1px);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--accent);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 20px;
}

.slider.round:before {
    border-radius: 50%;
}
/* --- Advanced Security Settings --- */
.set-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition);
}

.set-select:focus {
    border-color: var(--accent);
}

.recovery-key-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border);
    max-width: 480px;
    margin-top: 8px;
}

#set-recovery-key-val {
    font-family: 'Consolas', 'Cascadia Code', monospace;
    font-size: 14px;
    color: var(--accent);
    letter-spacing: 1px;
    flex: 1;
}

.set-btn-small {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.set-btn-small:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.set-btn-small:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.08);
}

/* --- User Management --- */
.users-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
    max-width: 480px;
}

.user-mgmt-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: background 0.3s;
}

.user-mgmt-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.user-mgmt-info {
    flex: 1;
}

.user-mgmt-name {
    font-size: 15px;
    font-weight: 600;
    color: white;
}

.user-mgmt-role {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* --- About Panel --- */
.about-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
    backdrop-filter: blur(20px);
}

.about-logo {
    width: 80px;
    height: 80px;
    background: var(--accent-glow);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.about-logo .material-icons-round {
    font-size: 48px;
    color: #fff;
}

.about-info h4 {
    font-size: 22px;
    margin-bottom: 8px;
    color: #fff;
}

.about-info p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.about-copyright {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 20px;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

/* --- AI Settings Panel --- */
.ai-settings-panel {
    max-width: 500px;
}

.api-key-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* --- Standalone About App --- */
.app-about {
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    background: rgba(0, 0, 0, 0.4);
}

.app-about .about-logo {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--accent), #e056fd);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}

.app-about .about-logo .material-icons-round {
    font-size: 56px;
    color: #fff;
}

.app-about h2 {
    font-size: 32px;
    margin-bottom: 8px;
    font-weight: 700;
    color: #fff;
}

.app-about .about-version {
    font-size: 15px;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 20px;
}

.app-about .about-details {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    max-width: 500px;
    text-align: left;
    backdrop-filter: blur(10px);
}

.app-about .about-details p {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 8px;
}

.app-about .about-details hr {
    border: none;
    border-top: 1px dashed var(--border);
    margin: 16px 0;
}

.app-about .about-details ul {
    list-style-type: none;
    padding-left: 0;
    margin-top: 8px;
}

.app-about .about-details li {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: flex;
    align-items: flex-start;
}

.app-about .about-details li::before {
    content: '';
    color: var(--accent);
    margin-right: 8px;
    font-weight: bold;
}

.app-about .about-copy {
    margin-top: 30px;
    font-size: 12px;
    color: var(--text-muted);
}
