/* NIR Apps Grid - Frontend Styles */

/* Button Styles */
.nir-apps-button {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(30, 60, 114, 0.3);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.nir-apps-button:hover {
    background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 60, 114, 0.4);
}

.nir-apps-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(30, 60, 114, 0.3);
}

/* Modal Overlay */
.nir-apps-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 999999;
    display: none;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.nir-apps-modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal Container */
.nir-apps-modal {
    background: white;
    border-radius: 20px;
    padding: 0;
    max-width: 95vw;
    max-height: 95vh;
    width: 1000px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
    overflow: hidden;
    position: relative;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close Button */
.nir-apps-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #666;
}

.nir-apps-close:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    color: #333;
}

/* Modal Header */
.nir-apps-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

.nir-apps-title {
    font-size: 28px;
    font-weight: bold;
    margin: 0 0 8px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.nir-apps-subtitle {
    font-size: 16px;
    opacity: 0.9;
    margin: 0 0 20px 0;
}

.nir-bookmark-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nir-bookmark-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Apps Grid */
.nir-apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 30px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Individual App Items */
.nir-app-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 2px solid #f0f0f0;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 140px;
}

.nir-app-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    border-color: transparent;
    text-decoration: none;
}

.nir-app-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--app-bg-color, #1e3c72);
}

.nir-app-icon {
    font-size: 32px;
    margin-bottom: 12px;
    display: block;
}

.nir-app-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 6px;
    color: #2c3e50;
    line-height: 1.3;
}

.nir-app-subtitle {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 8px;
}

.nir-app-url {
    font-size: 12px;
    color: #95a5a6;
    margin-top: auto;
    opacity: 0.8;
}

/* Status indicators */
.nir-app-item[data-status="online"]::after {
    content: '';
    position: absolute;
    top: 15px;
    right: 15px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #27ae60;
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.3);
}

/* Scrollbar styling for the grid */
.nir-apps-grid::-webkit-scrollbar {
    width: 8px;
}

.nir-apps-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.nir-apps-grid::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.nir-apps-grid::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .nir-apps-modal {
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-width: 100vw;
        max-height: 100vh;
    }
    
    .nir-apps-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
        padding: 20px;
        max-height: calc(100vh - 200px);
    }
    
    .nir-apps-title {
        font-size: 24px;
    }
    
    .nir-apps-subtitle {
        font-size: 14px;
    }
    
    .nir-apps-header {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .nir-apps-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 15px;
    }
    
    .nir-app-item {
        padding: 15px;
        min-height: 120px;
    }
    
    .nir-app-icon {
        font-size: 28px;
        margin-bottom: 10px;
    }
    
    .nir-app-title {
        font-size: 15px;
    }
}