/* Apps Page Layout */
.apps-page {
    padding: 20px;
    max-width: 1100px;
    margin: 90px auto 0;
    font-family: sans-serif;
}

/* Header & Search Bar */
.apps-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.apps-header h1 { color: #007bff; margin: 0; font-size: 2rem; }
.apps-header p { color: #666; margin: 5px 0 0 0; }

#appSearch {
    padding: 12px 20px;
    width: 300px;
    border-radius: 25px;
    border: 1px solid #ced4da;
    outline: none;
    transition: 0.2s;
}

#appSearch:focus {
    border-color: #007bff;
    box-shadow: 0 0 8px rgba(0,123,255,0.2);
}

/* Category Buttons */
.app-categories {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    overflow-x: auto; /* For mobile scroll */
    padding-bottom: 5px;
}

.cat-btn {
    background: #fff;
    border: 1px solid #d1d9e0;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s;
    font-weight: 500;
}

.cat-btn.active, .cat-btn:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* App Grid */
.apps-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.app-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid #eef2f6;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.app-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.08);
}

.app-icon {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.app-details h3 { margin: 0; font-size: 1.1rem; color: #1c1e21; }
.app-details p { margin: 4px 0 0 0; font-size: 0.85rem; color: #777; line-height: 1.3; }

/* The Windowed View */
.app-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    z-index: 11000;
}

.app-window {
    width: 90%;
    height: 85%;
    background: white;
    margin: 40px auto;
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}

.app-header-bar {
    background: #ffffff;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.app-header-bar span { font-weight: 600; color: #333; }

/* The "X" Close Button */
.min-btn {
    background: #f1f3f5;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #666;
    transition: 0.2s;
}

.min-btn:hover {
    background: #ff4d4f;
    color: white;
}

#appFrame {
    flex: 1;
    border: none;
    background: #fff;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .apps-header { flex-direction: column; align-items: flex-start; }
    #appSearch { width: 100%; }
    .app-window { width: 95%; height: 95%; margin: 2.5% auto; }
}