/* Apps Page Container */
.apps-page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    min-height: 100vh;
}

/* App Controls Section */
.app-controls {
    margin-bottom: 2rem;
}

.search-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 600px;
    min-width: 280px;
}

.app-search-input {
    width: -webkit-fill-available!important;
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(30, 30, 30, 0.7);
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.app-search-input:focus {
    outline: none;
    border-color: #ff6600;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.2);
}

.search-button {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #868686;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.search-button:hover {
    color: #ff6600;
}

/* Apps Grid */
.apps-grid-container {
    margin-bottom: 2rem;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.app-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(30, 30, 30, 0.7);
    transition: all 0.3s ease;
    aspect-ratio: 16/9;
    cursor: pointer;
}

.app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.app-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.app-card:hover .app-image {
    transform: scale(1.05);
}

.app-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    color: white;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.app-card:hover .app-overlay {
    transform: translateY(0);
}

.app-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    text-align: center;
}

/* Search Results Info */
.search-results-info {
    text-align: center;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(30, 30, 30, 0.7);
    border-radius: 12px;
    color: white;
    backdrop-filter: blur(10px);
}

.clear-search-button {
    margin-left: 1rem;
    padding: 0.5rem 1rem;
    background: #ff6600;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
}

.clear-search-button:hover {
    background: #ff8533;
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: #ff6600;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 102, 0, 0.3);
    z-index: 1000;
}

.scroll-to-top.visible {
    opacity: 1;
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(255, 102, 0, 0.4);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 102, 0, 0.3);
    border-radius: 50%;
    border-top-color: #ff6600;
    animation: spin 1s linear infinite;
}

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

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.app-card {
    animation: fadeIn 0.5s ease forwards;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(30, 30, 30, 0.5);
}

::-webkit-scrollbar-thumb {
    background: #ff6600;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff8533;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .apps-page-container {
        padding: 1rem;
        margin: 100px 20px 50px 62px;
    }

    .search-wrapper {
        flex-direction: column;
    }

    .search-box {
        width: 100%;
    }

    .apps-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    .scroll-to-top {
        bottom: 1rem;
        right: 1rem;
    }
} 

/* Custom Window System */
.app-window-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
}

.app-window {
    position: absolute;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    pointer-events: all;
    min-width: 400px;
    min-height: 300px;
    resize: both;
    display: flex;
    flex-direction: column;
}

.app-window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
    resize: none;
}

.app-window-header {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #333;
    cursor: move;
    user-select: none;
    min-height: 40px;
}

.app-window-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-window-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.app-window-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #ccc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 12px;
}

.app-window-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.app-window-btn.close:hover {
    background: #e74c3c;
    color: #fff;
}

.app-window-btn.maximize:hover {
    background: #27ae60;
    color: #fff;
}

.app-window-btn.minimize:hover {
    background: #f39c12;
    color: #fff;
}

.app-window-content {
    flex: 1;
    background: #fff;
    position: relative;
    overflow: hidden;
}

.app-window-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

.app-window-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    cursor: nw-resize;
    background: linear-gradient(-45deg, transparent 30%, #666 30%, #666 40%, transparent 40%);
}

.app-window.maximized .app-window-resize-handle {
    display: none;
}

/* Window animations */
.app-window {
    animation: windowOpen 0.3s ease-out;
}

@keyframes windowOpen {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.app-window.closing {
    animation: windowClose 0.2s ease-in forwards;
}

@keyframes windowClose {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* Window focus states */
.app-window {
    z-index: 1001;
}

.app-window.focused {
    z-index: 1002;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 0 2px #de5c34;
}

/* Loading state */
.app-window-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 14px;
}

.app-window-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top: 2px solid #de5c34;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}