/* App-specific styles */

/* ===== FILE MANAGER ===== */
.file-manager {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
}

.file-manager-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    background: linear-gradient(to bottom, #f8f8f8 0%, #e8e8e8 100%);
    border-bottom: 1px solid #ccc;
}

.file-manager-toolbar button {
    padding: 4px 8px;
    border: 1px solid #aaa;
    border-radius: 3px;
    background: linear-gradient(to bottom, #fafafa 0%, #e0e0e0 100%);
    cursor: pointer;
    font-size: 12px;
}

.file-manager-toolbar button:hover {
    background: linear-gradient(to bottom, #fff 0%, #eee 100%);
}

.file-manager-toolbar button:active {
    background: linear-gradient(to bottom, #ddd 0%, #ccc 100%);
}

.file-manager-path {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid #aaa;
    border-radius: 3px;
    background: #fff;
    font-family: 'Ubuntu Mono', monospace;
    font-size: 12px;
}

.file-manager-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.file-manager-sidebar {
    width: 150px;
    background: #f0f0f0;
    border-right: 1px solid #ccc;
    padding: 8px 0;
    overflow-y: auto;
}

.sidebar-item {
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-dark);
}

.sidebar-item:hover {
    background: #e0e0e0;
}

.sidebar-item.active {
    background: var(--accent);
    color: white;
}

.file-manager-files {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
    align-content: start;
}

.file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
}

.file-item:hover {
    background: #e8e8e8;
}

.file-item.selected {
    background: rgba(135, 167, 82, 0.3);
}

.file-item .file-icon {
    font-size: 40px;
    margin-bottom: 4px;
}

.file-item .file-name {
    font-size: 11px;
    word-break: break-word;
    color: var(--text-dark);
}

/* ===== TERMINAL ===== */
.terminal-app {
    height: 100%;
    background: #1a1a1a;
    padding: 0;
    overflow: hidden;
}

.terminal-container {
    height: 100%;
    padding: 8px;
    font-family: 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.4;
    color: #00ff00;
    overflow-y: auto;
}

.terminal-output {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.terminal-line {
    min-height: 1.4em;
}

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

.terminal-prompt .user {
    color: #5af;
}

.terminal-prompt .host {
    color: #5af;
}

.terminal-prompt .path {
    color: #87a752;
}

.terminal-input-line {
    display: flex;
    align-items: center;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #00ff00;
    font-family: inherit;
    font-size: inherit;
    caret-color: #00ff00;
}

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 14px;
    background: #00ff00;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Terminal colors */
.term-red { color: #f55; }
.term-green { color: #5f5; }
.term-yellow { color: #ff5; }
.term-blue { color: #5af; }
.term-magenta { color: #f5f; }
.term-cyan { color: #5ff; }
.term-white { color: #fff; }
.term-gray { color: #888; }
.term-bold { font-weight: bold; }

/* ===== BROWSER ===== */
.browser-app {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
}

.browser-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: linear-gradient(to bottom, #f8f8f8 0%, #e8e8e8 100%);
    border-bottom: 1px solid #ccc;
}

.browser-toolbar button {
    width: 28px;
    height: 28px;
    border: 1px solid #aaa;
    border-radius: 3px;
    background: linear-gradient(to bottom, #fafafa 0%, #e0e0e0 100%);
    cursor: pointer;
    font-size: 14px;
}

.browser-toolbar button:hover {
    background: linear-gradient(to bottom, #fff 0%, #eee 100%);
}

.browser-toolbar button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.browser-url {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #aaa;
    border-radius: 3px;
    background: #fff;
    font-size: 13px;
}

.browser-url:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 2px rgba(135, 167, 82, 0.3);
}

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

.browser-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.browser-home {
    padding: 40px;
    text-align: center;
}

.browser-home h2 {
    color: var(--text-dark);
    margin-bottom: 20px;
}

.browser-bookmarks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.bookmark {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border-radius: 8px;
    background: #f5f5f5;
    cursor: pointer;
    transition: all 0.15s;
}

.bookmark:hover {
    background: #e8e8e8;
    transform: translateY(-2px);
}

.bookmark .bookmark-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.bookmark .bookmark-name {
    font-size: 12px;
    color: var(--text-dark);
}

/* ===== TEXT EDITOR ===== */
.text-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
}

.text-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    background: linear-gradient(to bottom, #f8f8f8 0%, #e8e8e8 100%);
    border-bottom: 1px solid #ccc;
}

.text-editor-toolbar button {
    padding: 4px 10px;
    border: 1px solid #aaa;
    border-radius: 3px;
    background: linear-gradient(to bottom, #fafafa 0%, #e0e0e0 100%);
    cursor: pointer;
    font-size: 12px;
}

.text-editor-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.line-numbers {
    width: 50px;
    background: #f0f0f0;
    border-right: 1px solid #ddd;
    padding: 10px 0;
    text-align: right;
    font-family: 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #888;
    overflow: hidden;
    user-select: none;
}

.line-numbers div {
    padding-right: 10px;
}

.text-editor-textarea {
    flex: 1;
    padding: 10px;
    border: none;
    outline: none;
    resize: none;
    font-family: 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    background: #fff;
    color: var(--text-dark);
}

/* ===== SETTINGS ===== */
.settings-app {
    display: flex;
    height: 100%;
    background: #f5f5f5;
}

.settings-sidebar {
    width: 200px;
    background: #e8e8e8;
    border-right: 1px solid #ccc;
    padding: 10px 0;
}

.settings-category {
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-dark);
}

.settings-category:hover {
    background: #ddd;
}

.settings-category.active {
    background: var(--accent);
    color: white;
}

.settings-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.settings-section h2 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ccc;
    color: var(--text-dark);
}

.settings-option {
    margin-bottom: 20px;
}

.settings-option label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-dark);
}

.settings-option input[type="text"],
.settings-option select {
    width: 100%;
    max-width: 300px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.settings-option input[type="checkbox"] {
    margin-right: 8px;
}

/* ===== CODE PLAYGROUND ===== */
.hackers-game-app {
    height: 100%;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    font-family: 'Ubuntu Mono', monospace;
}

.game-screen {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    color: #87a752;
    line-height: 1.5;
}

.game-title {
    text-align: center;
    margin-bottom: 20px;
}

.game-title pre {
    color: #87a752;
    font-size: 10px;
    line-height: 1.2;
}

.game-menu {
    text-align: center;
    margin-top: 30px;
}

.game-menu-item {
    display: block;
    padding: 10px 20px;
    margin: 10px auto;
    max-width: 300px;
    background: transparent;
    border: 1px solid #87a752;
    color: #87a752;
    font-family: inherit;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.game-menu-item:hover {
    background: #87a752;
    color: #000;
}

.game-content {
    white-space: pre-wrap;
}

.game-back-btn {
    background: none;
    border: 1px solid #87a752;
    color: #87a752;
    padding: 5px 15px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.game-back-btn:hover {
    background: #87a752;
    color: #000;
}

.game-input-line {
    display: flex;
    margin-top: 10px;
}

.game-input {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 1px solid #87a752;
    outline: none;
    color: #87a752;
    font-family: inherit;
    font-size: 14px;
    padding: 4px;
}

/* Typewriter effect */
.typewriter {
    overflow: hidden;
    border-right: 2px solid #87a752;
    white-space: nowrap;
    animation: typing 2s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    50% { border-color: transparent; }
}

/* Matrix rain effect for special screens */
.matrix-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 0;
    opacity: 0.1;
}

/* Loading spinner */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #888;
}

.loading::after {
    content: '';
    width: 30px;
    height: 30px;
    border: 3px solid #ddd;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
