/**
 * Portal Main Styles
 * Modern UI with Glass Morphism
 * 
 * @package Portal
 * @version 1.0.0
 */

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    
    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.2);
    
    /* Shadows */
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.15);
    
    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
}

body {
    font-family: 'Kanit', sans-serif;
    background-color: #667eea; /* Fallback สำหรับอุปกรณ์ที่ไม่รองรับ gradient */
    background: var(--primary-gradient);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: cover;
    min-height: -webkit-fill-available;
    min-height: 100vh;
    line-height: 1.6;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    height: -webkit-fill-available;
}

/* ===== News Ticker ===== */
.news-ticker {
    background: linear-gradient(90deg, rgba(102,126,234,0.95), rgba(118,75,162,0.95));
    color: white;
    padding: 10px 0;
    overflow: hidden;
    position: relative;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.news-content {
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%;
    animation: scroll-left 75s linear infinite;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

@keyframes scroll-left {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(-100%, 0);
    }
}

.news-ticker:hover .news-content {
    animation-play-state: paused;
}

.news-manage-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.news-manage-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ===== Header ===== */
.header-glass {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

/* ===== Search Box ===== */
.search-wrapper {
    position: relative;
    max-width: 800px;
    margin: 0 auto 3rem;
}

.search-glow {
    position: absolute;
    inset: -0.5px;
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
    filter: blur(8px);
    opacity: 0.2;
    transition: var(--transition-smooth);
}

.search-wrapper:hover .search-glow,
.search-wrapper:focus-within .search-glow {
    opacity: 0.4;
}

.search-input {
    position: relative;
    width: 100%;
    padding: 1.25rem 1.5rem 1.25rem 3.5rem;
    border-radius: var(--radius-full);
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    font-size: 1.1rem;
    transition: var(--transition-smooth);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.search-input:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    pointer-events: none;
}

/* Quick Search Dropdown */
.quick-search-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.08);
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-search-dropdown.show {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.quick-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(102, 126, 234, 0.03);
}

.quick-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.quick-search-item:last-child {
    border-bottom: none;
}

.quick-search-item:hover {
    background: rgba(102, 126, 234, 0.05);
    padding-left: 20px;
}

.quick-search-item mark {
    background: #fef08a;
    color: #854d0e;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 4px;
}

.quick-search-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: #6b7280;
}

.quick-search-empty i {
    margin: 0 auto;
    display: block;
}

.search-kbd {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    font-family: monospace;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-kbd:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-50%) scale(1.05);
}

/* ===== Enhanced Search Modal ===== */
.search-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    z-index: 9999;
    animation: fadeIn 0.2s ease-out;
}

.search-modal.hidden {
    display: none;
}

.search-modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 700px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    animation: slideDown 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.search-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.search-modal-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-modal-icon {
    position: absolute;
    left: 16px;
    width: 20px;
    height: 20px;
    color: #9ca3af;
}

.search-modal-input {
    width: 100%;
    padding: 14px 80px 14px 50px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Kanit', sans-serif;
    transition: all 0.3s ease;
}

.search-modal-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-modal-kbd {
    position: absolute;
    right: 16px;
    padding: 4px 12px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    font-family: monospace;
}

.search-modal-results {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.search-section {
    margin-bottom: 20px;
}

.search-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin-bottom: 8px;
}

.search-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-clear-btn {
    font-size: 0.75rem;
    color: var(--primary-color);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.search-clear-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

.search-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.search-item:hover,
.search-item.active {
    background: rgba(102, 126, 234, 0.1);
}

.search-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.search-item-content {
    flex: 1;
    min-width: 0;
}

.search-item-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
}

.search-item-title mark,
.search-item-description mark {
    background: #fef08a;
    color: #854d0e;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 3px;
}

.search-item-description {
    font-size: 0.8rem;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-item-badge {
    padding: 4px 8px;
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
}

.search-empty {
    text-align: center;
    padding: 60px 20px;
}

.search-empty-icon {
    width: 64px;
    height: 64px;
    color: #d1d5db;
    margin: 0 auto 16px;
}

.search-empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 8px;
}

.search-empty-text {
    font-size: 0.9rem;
    color: #9ca3af;
}

.search-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f9fafb;
    border-radius: 0 0 16px 16px;
}

.search-tips {
    display: flex;
    gap: 16px;
}

.search-tip {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #6b7280;
}

.search-tip kbd {
    padding: 2px 6px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: monospace;
}

.search-powered {
    font-size: 0.7rem;
    color: #9ca3af;
}

/* ===== App Cards ===== */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

.app-card {
    background-color: #ffffff;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition-smooth);
    border: 1px solid var(--glass-border);
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 180px;
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.app-card:hover::before {
    transform: scaleX(1);
}

.app-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

/* App Actions (Edit/Delete buttons) */
.app-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
    z-index: 10;
}

/* Show actions only in admin mode */
.admin-mode .app-card:hover .app-actions {
    opacity: 1;
    visibility: visible;
}

.action-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.edit-btn {
    background: rgba(59, 130, 246, 0.9);
    color: white;
}

.edit-btn:hover {
    background: rgb(37, 99, 235);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.delete-btn {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.delete-btn:hover {
    background: rgb(220, 38, 38);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.app-icon-wrapper {
    background: linear-gradient(135deg, #f6f8fb 0%, #e9ecef 100%);
    padding: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    min-height: 190px;
}

.app-icon-wrapper::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.app-card:hover .app-icon-wrapper::after {
    opacity: 1;
}

.app-icon {
    width: 110px;
    height: 110px;
    border-radius: 24px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.15);
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
    object-fit: cover;
}

.app-card:hover .app-icon {
    transform: scale(1.1) rotate(5deg);
}

.app-content {
    background: #ffffff;
    padding: 16px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.app-title {
    color: #333;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 6px;
    transition: color 0.3s ease;
    line-height: 1.3;
}

.app-card:hover .app-title {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-description {
    color: #666;
    font-size: 0.78rem;
    font-weight: 300;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    color: #666;
    max-width: 500px;
    margin: 0 auto;
}

/* ===== Footer ===== */
.footer-glass {
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--glass-border);
    color: white;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* ===== Responsive ===== */
/* Large Desktop (1600px+) - 4 columns */
@media (min-width: 1600px) {
    .apps-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Desktop (1200px - 1599px) - 4 columns */
@media (min-width: 1200px) and (max-width: 1599px) {
    .apps-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Tablet Landscape (992px - 1199px) - 3 columns */
@media (min-width: 992px) and (max-width: 1199px) {
    .apps-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

/* Tablet Portrait (768px - 991px) - 2 columns */
@media (min-width: 768px) and (max-width: 991px) {
    .apps-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .app-icon {
        width: 90px;
        height: 90px;
    }
    
    .app-content {
        padding: 16px;
    }
    
    .app-title {
        font-size: 0.95rem;
    }
    
    .app-description {
        font-size: 0.8rem;
    }
}

/* Mobile (max-width: 767px) - 1 column */
@media (max-width: 767px) {
    .apps-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 16px;
    }
    
    .app-icon-wrapper {
        padding: 28px;
        min-height: 150px;
    }
    
    .app-icon {
        width: 100px;
        height: 100px;
    }
    
    .app-content {
        padding: 16px;
    }
    
    .app-title {
        font-size: 1rem;
    }
    
    .app-description {
        font-size: 0.85rem;
    }
}

/* Mobile Small (max-width: 480px) */
@media (max-width: 480px) {
    .search-input {
        font-size: 1rem;
        padding: 1rem 1.25rem 1rem 3rem;
    }
    
    .search-icon {
        left: 1rem;
    }
    
    .floating-btn {
        width: 56px;
        height: 56px;
        bottom: 20px;
        right: 20px;
    }
}

/* ===== Modal ===== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.close-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition-smooth);
}

.close-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    font-family: 'Kanit', sans-serif;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

/* Icon Preview */
.icon-preview-wrapper {
    margin-bottom: 16px;
}

.icon-preview {
    width: 120px;
    height: 120px;
    border: 2px dashed #d1d5db;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    background: #f9fafb;
    transition: var(--transition-smooth);
}

.icon-preview:hover {
    border-color: var(--primary-color);
    background: #f3f4f6;
}

.icon-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

/* File Upload */
.file-upload-wrapper {
    text-align: center;
}

.file-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #f3f4f6;
    border: 2px dashed #d1d5db;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
}

.file-upload-label:hover {
    background: #e5e7eb;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Color Picker */
.color-picker-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

.color-input {
    width: 60px;
    height: 48px;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.color-input:hover {
    border-color: var(--primary-color);
}

.color-presets {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.color-preset {
    width: 40px;
    height: 40px;
    border: 3px solid white;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.color-preset:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: 'Kanit', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex: 1;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f3f4f6;
    color: #6b7280;
    flex: 1;
}

.btn-secondary:hover {
    background: #e5e7eb;
    color: #374151;
}


/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   FLOATING ACTION BUTTONS
   ============================================ */

.fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 900;
}

.fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.fab:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.fab:active {
    transform: scale(0.95);
}

/* Add App Button - Primary (Purple) */
.fab-add {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.fab-add:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
}

/* Scroll to Top Button - Secondary (Blue) */
.fab-scroll {
    background: rgba(59, 130, 246, 0.95);
    color: white;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.fab-scroll.show {
    opacity: 1;
    visibility: visible;
}

.fab-scroll:hover {
    background: rgba(37, 99, 235, 1);
}

/* AI Assistant Button - Accent (Gradient) */
.fab-ai {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    animation: pulse-glow 2s ease-in-out infinite;
}

.fab-ai:hover {
    background: linear-gradient(135deg, #e082ea 0%, #e4465b 100%);
    animation: none;
}

/* AI Status Indicator */
.fab-ai::before {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid white;
    animation: pulse-dot 2s ease-in-out infinite;
}

.fab-ai.offline::before {
    background: #ef4444;
    animation: none;
}

/* FAB Tooltip */
.fab-tooltip {
    position: absolute;
    right: 70px;
    background: rgba(17, 24, 39, 0.95);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.fab:hover .fab-tooltip {
    opacity: 1;
    visibility: visible;
    right: 72px;
}

/* Animations */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
    }
    50% {
        box-shadow: 0 4px 24px rgba(245, 87, 108, 0.6);
    }
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Slide in animation on load */
.fab {
    animation: slideInFab 0.5s ease-out backwards;
}

.fab:nth-child(1) { animation-delay: 0.1s; }
.fab:nth-child(2) { animation-delay: 0.2s; }
.fab:nth-child(3) { animation-delay: 0.3s; }

@keyframes slideInFab {
    from {
        opacity: 0;
        transform: translateX(100px) scale(0.5);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .fab-container {
        bottom: 20px;
        right: 20px;
        gap: 12px;
    }
    
    .fab {
        width: 48px;
        height: 48px;
    }
    
    .fab-tooltip {
        display: none;
    }
}

/* ============================================
   ADVANCED ANIMATIONS & TRANSITIONS
   ============================================ */

/* Enhanced Page Load Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes floatUp {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-200deg);
    }
    to {
        opacity: 1;
        transform: rotate(0deg);
    }
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(102, 126, 234, 0.5), 0 0 10px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.8), 0 0 30px rgba(102, 126, 234, 0.6);
    }
}

/* Loading Animations */
@keyframes spinLoader {
    to {
        transform: rotate(360deg);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes dotsLoading {
    0%, 20% {
        color: transparent;
        text-shadow: 0 0 0 #667eea;
        transform: scale(1);
    }
    40% {
        color: #667eea;
        text-shadow: 0 0 0 transparent;
        transform: scale(1.2);
    }
    60%, 100% {
        color: transparent;
        text-shadow: 0 0 0 #667eea;
        transform: scale(1);
    }
}

/* Enhanced Hover Effects */
.enhanced-hover {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.enhanced-hover:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.enhanced-hover:hover:before {
    left: 100%;
}

.enhanced-hover:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Glass Morphism Enhancement */
.glass-enhanced {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.98);
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Stagger Animation Classes */
.stagger-animation > * {
    animation: fadeInUp 0.6s ease-out backwards;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.6s; }
.stagger-animation > *:nth-child(7) { animation-delay: 0.7s; }
.stagger-animation > *:nth-child(8) { animation-delay: 0.8s; }

/* Loading States */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spinLoader 1s linear infinite;
}

.loading-dots:after {
    content: '...';
    animation: dotsLoading 1.5s steps(4, end) infinite;
}

/* Interactive Elements */
.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.clickable:hover {
    transform: translateY(-1px);
}

.clickable:active {
    transform: translateY(1px) scale(0.98);
}

/* Notification Animations */
@keyframes slideInNotification {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutNotification {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Apply animations to existing elements */
.app-card {
    animation: scaleIn 0.5s ease-out backwards;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.app-icon {
    transition: transform 0.3s ease;
}

.app-card:hover .app-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Header Animations */
header {
    animation: slideInLeft 0.8s ease-out;
}

/* Search Box Enhancements */
.search-container {
    transition: all 0.3s ease;
}

.search-container:focus-within {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

/* Button Enhancements */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: width 0.6s, height 0.6s;
    transform: translate(-50%, -50%);
}

.btn:active:before {
    width: 300px;
    height: 300px;
}

/* ============================================
   AI CHAT MODAL
   ============================================ */

.ai-chat-container {
    width: 90%;
    max-width: 800px;
    height: 85vh;
    max-height: 700px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Header */
.ai-chat-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.ai-avatar {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ai-chat-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.ai-chat-subtitle {
    font-size: 13px;
    opacity: 0.95;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.ai-status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    animation: pulse-dot 2s ease-in-out infinite;
}

.ai-close-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ai-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Suggestions */
.ai-suggestions {
    padding: 32px 24px;
    flex-shrink: 0;
}

.ai-welcome {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 20px;
    text-align: center;
}

.ai-suggestion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.ai-suggestion-btn {
    padding: 16px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.ai-suggestion-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.ai-suggestion-btn span {
    font-size: 13px;
    font-weight: 500;
}

/* Messages */
.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #f9fafb;
    display: none; /* Hidden until first message */
}

.ai-messages.active {
    display: block;
}

.ai-message {
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    animation: fadeIn 0.4s ease;
}

.ai-message.user {
    flex-direction: row-reverse;
}

.ai-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-message.assistant .ai-message-avatar {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.ai-message.user .ai-message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ai-message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 16px;
    position: relative;
}

.ai-message.assistant .ai-message-bubble {
    background: white;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ai-message.user .ai-message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-message-text {
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    word-wrap: break-word;
}

.ai-message-time {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 4px;
}

/* Typing Indicator */
.ai-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.ai-typing-dot {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing-bounce 1.4s ease-in-out infinite;
}

.ai-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-8px);
    }
}

/* Input Area */
.ai-input-area {
    padding: 16px 24px;
    background: white;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.ai-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.ai-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.ai-input:focus {
    outline: none;
    border-color: #f5576c;
}

.ai-send-btn {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.ai-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(245, 87, 108, 0.3);
}

.ai-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-input-hint {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
}

.ai-input-hint kbd {
    padding: 2px 6px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 11px;
    font-family: monospace;
}

/* Responsive */
@media (max-width: 768px) {
    .ai-chat-container {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .ai-suggestion-grid {
        grid-template-columns: 1fr;
    }
    
    .ai-message-bubble {
        max-width: 85%;
    }
}

/* ============================================
   ADMIN LOGIN SYSTEM
   ============================================ */

/* Header Admin Controls */
.admin-login-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    color: #667eea;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-login-trigger:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.admin-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    animation: pulse-glow-green 2s ease-in-out infinite;
}

@keyframes pulse-glow-green {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    }
    50% {
        box-shadow: 0 2px 16px rgba(16, 185, 129, 0.5);
    }
}

/* Admin Login Modal */
.admin-login-container {
    width: 90%;
    max-width: 480px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-login-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-avatar {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.admin-avatar-success {
    background: rgba(16, 185, 129, 0.2);
}

.admin-login-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.admin-login-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 2px;
}

.admin-close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.admin-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Login Form */
.admin-login-body {
    padding: 32px 24px;
}

.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: #374151;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
}

.checkbox {
    appearance: none;
    width: 16px;
    height: 16px;
    margin: 0;
    position: relative;
}

.checkbox-custom {
    width: 16px;
    height: 16px;
    border: 2px solid #d1d5db;
    border-radius: 3px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox:checked + .checkbox-custom {
    background: #667eea;
    border-color: #667eea;
}

.checkbox:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 2px;
    top: -1px;
    width: 6px;
    height: 10px;
    border: 2px solid white;
    border-left: none;
    border-top: none;
    transform: rotate(45deg);
}

.admin-login-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.admin-login-actions .btn {
    flex: 1;
}

/* Admin Status (After Login) */
.admin-status {
    padding: 32px 24px;
}

.admin-welcome {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 12px;
    border: 1px solid #bbf7d0;
}

.admin-welcome-title {
    font-size: 18px;
    font-weight: 700;
    color: #047857;
    margin: 0 0 4px 0;
}

.admin-welcome-subtitle {
    font-size: 14px;
    color: #059669;
    margin: 0;
}

.admin-permissions {
    margin-bottom: 24px;
}

.admin-permissions-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 12px 0;
}

.admin-permissions-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
}

.admin-permissions-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #475569;
    transition: all 0.3s ease;
}

.admin-permissions-list li:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateX(4px);
}

.admin-permissions-list li i {
    color: #667eea;
}

.admin-permission-link {
    width: 100%;
    cursor: pointer;
}

.admin-permission-link:hover {
    color: #667eea;
}

.admin-actions {
    display: flex;
    gap: 12px;
}

.admin-actions .btn {
    flex: 1;
}

/* App Cards Admin Mode */
.admin-mode .app-actions {
    opacity: 1 !important;
    visibility: visible !important;
}

.admin-mode .app-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.admin-mode .app-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Hide admin controls when not in admin mode */
body:not(.admin-mode) .fab-add {
    display: none !important;
}

body:not(.admin-mode) .app-actions {
    display: none !important;
}

body:not(.admin-mode) .news-manage-btn {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-login-container {
        width: 100%;
        max-width: none;
        border-radius: 0;
        height: 100vh;
        max-height: 100vh;
    }
    
    .admin-login-trigger span {
        display: none;
    }
    
    .admin-permissions-list {
        grid-template-columns: 1fr;
    }
    
    .admin-actions, .admin-login-actions {
        flex-direction: column;
    }
}

/* ============================================
   ENHANCED RESPONSIVE DESIGN
   ============================================ */

/* Mobile-First Responsive Breakpoints */
@media (max-width: 480px) {
    /* Extra Small Mobile - iPhone SE, Small Phones */
    .container {
        padding: 0 12px;
    }
    
    h2 {
        font-size: 1.75rem !important;
        line-height: 1.3;
    }
    
    p {
        font-size: 0.9rem;
    }
    
    .search-wrapper {
        margin: 0 12px 1.5rem !important;
        padding: 12px 16px !important;
    }
    
    .search-input {
        font-size: 16px !important; /* Prevent zoom on iOS */
        padding: 12px 12px 12px 48px !important;
    }
    
    .search-kbd {
        display: none; /* Hide keyboard shortcut on small screens */
    }
    
    .apps-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        padding: 0 12px !important;
    }
    
    .app-card {
        min-height: 160px !important;
        padding: 0;
    }
    
    .app-icon-wrapper {
        padding: 16px;
        min-height: 110px;
        flex-shrink: 0;
    }
    
    .app-icon {
        width: 80px !important;
        height: 80px !important;
    }
    
    .app-content {
        padding: 12px !important;
    }
    
    .app-title {
        font-size: 0.88rem !important;
        margin-bottom: 4px;
        line-height: 1.2;
    }
    
    .app-description {
        font-size: 0.76rem !important;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-clamp: 2;
        overflow: hidden;
    }
    
    .fab-container {
        bottom: 16px;
        right: 16px;
        gap: 8px;
    }
    
    .fab {
        width: 48px !important;
        height: 48px !important;
    }
    
    .action-btn {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 640px) {
    /* Small Mobile - Most Phones */
    header {
        padding: 8px 0;
    }
    
    .header-container {
        padding: 0 16px;
    }
    
    main {
        padding: 16px 0;
    }
    
    .welcome-section {
        margin-bottom: 2rem;
        padding: 0 16px;
    }
    
    h2 {
        font-size: 1.9rem !important;
        margin-bottom: 1rem;
    }
    
    .enterprise-badge {
        font-size: 0.75rem;
        padding: 6px 12px;
        margin-bottom: 1rem;
    }
    
    .apps-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px !important;
        padding: 0 16px !important;
    }
    
    .app-card {
        min-height: 170px !important;
    }
    
    .app-icon-wrapper {
        padding: 16px;
        flex-shrink: 0;
    }
    
    .app-icon {
        width: 56px !important;
        height: 56px !important;
        border-radius: 10px;
    }
    
    .app-content {
        padding: 14px !important;
    }
    
    .app-title {
        font-size: 0.9rem !important;
        margin-bottom: 4px;
        line-height: 1.2;
    }
    
    .app-description {
        font-size: 0.8rem !important;
        line-height: 1.35;
    }
    
    .app-actions {
        top: 8px;
        right: 8px;
        gap: 4px;
    }
    
    .action-btn {
        width: 32px;
        height: 32px;
    }
    
    .fab-container {
        bottom: 16px;
        right: 16px;
        gap: 10px;
    }
    
    .fab {
        width: 52px !important;
        height: 52px !important;
    }
}

@media (max-width: 768px) {
    /* Mobile & Tablet Portrait */
    .apps-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
        padding: 0 16px !important;
    }
    
    .app-card {
        min-height: 175px !important;
    }
    
    .app-icon-wrapper {
        padding: 18px;
        flex-shrink: 0;
    }
    
    .app-icon {
        width: 58px !important;
        height: 58px !important;
    }
    
    .app-content {
        padding: 16px !important;
    }
    
    .app-title {
        font-size: 0.92rem !important;
        line-height: 1.3;
    }
    
    .app-description {
        font-size: 0.82rem !important;
        line-height: 1.4;
    }
    
    .search-wrapper {
        margin: 0 16px 2rem;
    }
    
    /* Modal Adjustments */
    .modal-backdrop .admin-login-container,
    .modal-backdrop .ai-chat-container {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    /* Touch-friendly buttons */
    .btn {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 16px;
    }
    
    .form-input {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 16px;
    }
    
    /* News ticker mobile optimization */
    .news-ticker {
        font-size: 0.9rem;
        padding: 8px 0;
    }
    
    .news-content {
        animation-duration: 45s; /* Slower on mobile */
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    /* Tablet Landscape */
    .apps-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 20px;
    }
    
    main {
        padding: 24px;
    }
}

@media (min-width: 1025px) and (max-width: 1280px) {
    /* Small Desktop */
    .apps-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 24px;
    }
    
    main {
        padding: 32px;
    }
}

/* Large Desktop */
@media (min-width: 1281px) {
    .apps-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 28px;
    }
    
    .app-icon-wrapper {
        padding: 20px;
    }
    
    .app-icon {
        width: 64px;
        height: 64px;
    }
    
    .app-content {
        padding: 18px;
    }
    
    .app-title {
        font-size: 0.95rem;
    }
    
    .app-description {
        font-size: 0.82rem;
    }
}

/* Ultra-wide Displays */
@media (min-width: 1920px) {
    .apps-grid {
        grid-template-columns: repeat(7, 1fr);
        max-width: 1400px;
        margin: 0 auto;
        gap: 30px;
    }
    
    .app-icon {
        width: 68px;
        height: 68px;
    }
    
    .app-title {
        font-size: 1rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Touch devices - iPad, iPhone, Android */
    body {
        background-color: #667eea !important;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        background-attachment: scroll !important; /* Fixed attachment can cause issues on iOS */
    }
    
    .app-card {
        background-color: #ffffff !important;
        background: #ffffff !important;
    }
    
    .app-content {
        background-color: #ffffff !important;
        background: #ffffff !important;
    }
    
    .app-icon-wrapper {
        background: linear-gradient(135deg, #f6f8fb 0%, #e9ecef 100%) !important;
    }
    
    .app-card:hover {
        transform: none;
    }
    
    .app-actions {
        opacity: 1;
        visibility: visible;
    }
    
    .enhanced-hover:hover {
        transform: none;
    }
    
    .fab:hover {
        transform: none;
    }
    
    /* Larger touch targets */
    .clickable {
        min-height: 44px;
        min-width: 44px;
    }
}

/* iPad Specific Fixes */
@media only screen 
  and (min-device-width: 768px) 
  and (max-device-width: 1024px) {
    /* iPad Portrait & Landscape */
    body {
        background-color: #667eea !important;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        background-attachment: scroll !important;
        background-repeat: no-repeat !important;
        background-size: cover !important;
    }
    
    html {
        background-color: #667eea;
    }
    
    .apps-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 20px !important;
    }
    
    .app-card {
        min-height: 200px !important;
        background-color: #ffffff !important;
        background: #ffffff !important;
    }
    
    .app-icon-wrapper {
        background: linear-gradient(135deg, #f6f8fb 0%, #e9ecef 100%) !important;
    }
    
    .app-icon {
        width: 64px !important;
        height: 64px !important;
    }
    
    .app-content {
        padding: 18px !important;
        background-color: #ffffff !important;
        background: #ffffff !important;
    }
    
    .app-title {
        font-size: 0.95rem !important;
        color: #333 !important;
    }
    
    .app-description {
        font-size: 0.85rem !important;
        color: #666 !important;
    }
}

/* iPad Pro Specific */
@media only screen 
  and (min-device-width: 1024px) 
  and (max-device-width: 1366px) 
  and (-webkit-min-device-pixel-ratio: 2) {
    body {
        background-color: #667eea !important;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        background-attachment: scroll !important;
    }
    
    .app-card {
        background-color: #ffffff !important;
        background: #ffffff !important;
    }
    
    .app-content {
        background-color: #ffffff !important;
        background: #ffffff !important;
    }
    
    .app-icon-wrapper {
        background: linear-gradient(135deg, #f6f8fb 0%, #e9ecef 100%) !important;
    }
}

/* Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .news-content {
        animation: none;
        transform: translateX(0);
    }
    
    .floatUp {
        animation: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .app-card {
        border: 2px solid #000;
        background: #fff;
    }
    
    .glass-card {
        background: #fff;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

/* Dark Mode Media Query (System Preference) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1a1a;
        --bg-secondary: #2d2d2d;
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --border-color: #404040;
    }
    
    body {
        background: var(--bg-primary);
        color: var(--text-primary);
    }
    
    .app-card {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    
    .glass-card {
        background: rgba(45, 45, 45, 0.95);
        border: 1px solid var(--border-color);
    }
}

/* Print Styles */
@media print {
    .fab-container,
    .admin-login-trigger,
    .search-wrapper,
    .news-ticker,
    .app-actions {
        display: none !important;
    }
    
    .app-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .apps-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    
    h2 {
        color: #000 !important;
    }
    
    p {
        color: #333 !important;
    }
}

/* ============================================
   MOBILE HAMBURGER MENU
   ============================================ */

/* Hamburger Toggle Button */
.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 60;
}

.mobile-menu-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

/* Hamburger Lines */
.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: #374151;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: center;
}

.hamburger-line:nth-child(1) {
    margin-bottom: 4px;
}

.hamburger-line:nth-child(2) {
    margin-bottom: 4px;
}

/* Hamburger Animation States */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ============================================
   ENHANCED AI CHAT STYLES
   ============================================ */

/* AI Chat Modal */
.ai-chat-container {
    width: 100%;
    max-width: 800px;
    height: 90vh;
    max-height: 700px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.98) 0%, 
        rgba(248, 250, 252, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    animation: aiModalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes aiModalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* AI Chat Header */
.ai-chat-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.ai-chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        transparent 50%, 
        rgba(255, 255, 255, 0.1) 100%);
    animation: aiHeaderShine 3s ease-in-out infinite;
}

@keyframes aiHeaderShine {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.ai-avatar {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    animation: aiAvatarPulse 2s ease-in-out infinite;
}

@keyframes aiAvatarPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.ai-chat-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ai-chat-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 4px 0 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: aiStatusBlink 2s ease-in-out infinite;
}

@keyframes aiStatusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ai-close-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.ai-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* AI Suggestions */
.ai-suggestions {
    padding: 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.ai-welcome {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 20px 0;
    text-align: center;
}

.ai-suggestion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.ai-suggestion-btn {
    padding: 16px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    font-size: 0.9rem;
    color: #374151;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ai-suggestion-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
}

.ai-suggestion-btn i {
    color: #667eea;
    flex-shrink: 0;
}

/* AI Messages Container */
.ai-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: linear-gradient(135deg, #fafbfc 0%, #f1f5f9 100%);
}

.ai-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.ai-messages::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
    transition: background 0.3s ease;
}

.ai-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* AI Message Styles */
.ai-message {
    display: flex;
    margin: 8px 0;
    opacity: 0;
    transform: translateY(20px);
    animation: messageSlideIn 0.4s ease forwards;
}

@keyframes messageSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-message-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 85%;
}

.ai-message-user .ai-message-content {
    margin-left: auto;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 4px;
}

.user-avatar {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.assistant-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    animation: assistantAvatarGlow 2s ease-in-out infinite;
}

@keyframes assistantAvatarGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(102, 126, 234, 0.1); }
}

.message-bubble {
    padding: 16px 20px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.user-bubble {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    margin-left: 8px;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.assistant-bubble {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(248, 250, 252, 0.95) 100%);
    color: #374151;
    margin-right: 8px;
    border-bottom-left-radius: 6px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.message-text {
    line-height: 1.6;
    font-size: 0.95rem;
}

.message-text strong {
    font-weight: 600;
    color: #1f2937;
}

.message-text em {
    font-style: italic;
    color: #6b7280;
}

.message-text code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    font-size: 0.85rem;
}

.message-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.message-time {
    font-size: 0.75rem;
    color: #9ca3af;
}

.message-controls {
    display: flex;
    gap: 6px;
}

.message-action-btn {
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #6b7280;
}

.message-action-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    transform: scale(1.1);
}

/* Thinking Animation */
.thinking-bubble {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.thinking-animation {
    display: flex;
    gap: 4px;
}

.thinking-dot {
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    animation: thinkingDot 1.4s infinite ease-in-out;
}

.thinking-dot:nth-child(1) { animation-delay: -0.32s; }
.thinking-dot:nth-child(2) { animation-delay: -0.16s; }
.thinking-dot:nth-child(3) { animation-delay: 0s; }

@keyframes thinkingDot {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.6; }
    40% { transform: scale(1.2); opacity: 1; }
}

.thinking-text {
    color: #6b7280;
    font-size: 0.9rem;
    font-style: italic;
}

/* AI Input Area */
.ai-input-area {
    padding: 20px 24px;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.ai-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.ai-input-wrapper:focus-within {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ai-input {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #374151;
    min-height: 20px;
    max-height: 120px;
    font-family: inherit;
}

.ai-input::placeholder {
    color: #9ca3af;
}

.ai-send-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.ai-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.ai-send-btn:active {
    transform: scale(0.95);
}

.ai-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ai-send-btn .animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.ai-input-hint {
    margin-top: 8px;
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: center;
}

.ai-input-hint kbd {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-family: inherit;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ai-chat-container {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        animation: aiModalSlideUp 0.4s ease forwards;
    }
    
    @keyframes aiModalSlideUp {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
    
    .ai-suggestion-grid {
        grid-template-columns: 1fr;
    }
    
    .ai-suggestion-btn {
        padding: 14px;
        font-size: 0.9rem;
    }
    
    .ai-messages {
        padding: 16px;
    }
    
    .message-bubble {
        padding: 14px 16px;
        font-size: 0.9rem;
    }
    
    .ai-input-area {
        padding: 16px;
    }
    
    .ai-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Menu Content */
.mobile-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(248, 250, 252, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow-y: auto;
    padding: 0;
}

.mobile-menu-overlay.active .mobile-menu-content {
    transform: translateX(0);
}

/* Mobile Menu Header */
.mobile-menu-header {
    display: flex;
    justify-content: between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    flex: 1;
}

.mobile-menu-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
}

.mobile-menu-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

.mobile-menu-close:active {
    transform: scale(0.95);
}

/* Mobile Menu Items */
.mobile-menu-items {
    padding: 24px;
}

/* Mobile Admin Section */
.mobile-admin-section {
    margin-bottom: 24px;
}

.mobile-admin-status {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.admin-status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 500;
}

.mobile-admin-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    justify-content: center;
}

.mobile-admin-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

.mobile-admin-login {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    justify-content: center;
}

.mobile-admin-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.mobile-admin-login:active {
    transform: translateY(0);
}

/* Mobile Menu Divider */
.mobile-menu-divider {
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 0, 0, 0.1) 50%, 
        transparent 100%);
    margin: 24px 0;
}

/* Mobile Quick Actions */
.mobile-quick-actions h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 16px 0;
}

.mobile-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    font-size: 0.95rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    text-align: left;
}

.mobile-action-btn:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(0, 0, 0, 0.1);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mobile-action-btn:active {
    transform: translateX(2px);
}

.mobile-action-btn i {
    color: #6b7280;
    transition: color 0.2s ease;
}

.mobile-action-btn:hover i {
    color: #3b82f6;
}

/* Mobile Menu Responsive Adjustments */
@media (max-width: 320px) {
    .mobile-menu-content {
        width: 100vw;
    }
    
    .mobile-menu-header {
        padding: 16px 20px;
    }
    
    .mobile-menu-items {
        padding: 20px;
    }
}

/* Mobile Menu Animation Delays */
.mobile-menu-overlay.active .mobile-admin-section {
    animation: slideInRight 0.4s ease 0.1s both;
}

.mobile-menu-overlay.active .mobile-quick-actions {
    animation: slideInRight 0.4s ease 0.2s both;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}


