/* Base Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
    color: #fff;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Navigation */
.navbar {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #3498db;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: #3498db;
}

/* Enhanced Unified CMMS Styling */
.cmms-header {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
}

.cmms-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.cmms-header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

/* Enhanced Cards with Glassmorphism */
.cmms-card {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 2rem;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.cmms-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Stats and Metrics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 1.5rem;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.status-operational,
.status-good {
    color: #38ef7d;
}

.status-maintenance,
.status-warning {
    color: #fbbf24;
}

.status-down,
.status-critical {
    color: #ff6b6b;
}

.status-overdue {
    color: #ff4757;
}

.status-due {
    color: #ffa726;
}

/* Enhanced Tables with Glassmorphism */
.cmms-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    overflow: hidden;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.cmms-table th,
.cmms-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cmms-table th {
    background: rgba(0, 0, 0, 0.3);
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Filter and Search with Enhanced Glassmorphism */
.filter-bar {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.filter-bar:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.filter-bar label {
    color: white;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.filter-bar select,
.filter-bar input {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.filter-bar select:focus,
.filter-bar input:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    outline: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.filter-bar select option {
    background: #2d3748;
    color: white;
}

.filter-bar input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* Enhanced Buttons with Glassmorphism */
.cmms-btn {
    background: linear-gradient(135deg, #38ef7d, #11998e);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    margin: 0.25rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 6px 24px rgba(56, 239, 125, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.cmms-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 32px rgba(56, 239, 125, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #44f47f, #13a294);
}

.cmms-btn-success {
    background: linear-gradient(135deg, #38ef7d, #11998e);
}

.cmms-btn-warning {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
}

.cmms-btn-warning:hover {
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.4);
}

.cmms-btn-danger {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.cmms-btn-danger:hover {
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.cmms-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Item Cards with Priority Styling */
.item-card {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.item-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.2);
}

.item-card.critical {
    border-left: 4px solid #ff4757;
    background: rgba(255, 71, 87, 0.1);
}

.item-card.high {
    border-left: 4px solid #ffa726;
    background: rgba(255, 167, 38, 0.1);
}

.item-card.medium {
    border-left: 4px solid #38ef7d;
    background: rgba(56, 239, 125, 0.1);
}

.item-card.low {
    border-left: 4px solid #74b9ff;
    background: rgba(116, 185, 255, 0.1);
}

.item-card.overdue {
    border-left: 4px solid #ff4757;
    background: rgba(255, 71, 87, 0.15);
    animation: pulse-warning 2s infinite;
}

.item-card.due {
    border-left: 4px solid #ffa726;
    background: rgba(255, 167, 38, 0.15);
}

@keyframes pulse-warning {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
    }

    50% {
        box-shadow: 0 6px 25px rgba(255, 71, 87, 0.6);
    }
}

/* Progress Bars */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #38ef7d, #11998e);
    transition: width 0.3s ease;
}

/* Badges */
.cmms-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-operational {
    background: rgba(56, 239, 125, 0.2);
    color: #38ef7d;
    border: 1px solid rgba(56, 239, 125, 0.3);
}

.badge-maintenance {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-down {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.3);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .cmms-header {
        padding: 1.5rem;
    }

    .cmms-header h1 {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar>* {
        width: 100%;
    }

    .cmms-card {
        padding: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }
}

/* Loading States */
.loading {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cmms-card,
.item-card,
.stat-card {
    animation: fadeIn 0.5s ease;
}

/* Bootstrap Dark Theme Overrides */
.form-control,
.form-select {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    backdrop-filter: blur(5px);
}

.form-control:focus,
.form-select:focus {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: #3498db;
    color: #fff;
    box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Fix Bootstrap Card Backgrounds */
.card {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.card-header {
    background-color: rgba(0, 0, 0, 0.2) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.card-title {
    color: #fff;
}

/* Modal Dark Theme */
.modal-content {
    background-color: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Table Overrides */
.table {
    color: #fff;
    --bs-table-bg: transparent;
    --bs-table-color: #fff;
}

.table> :not(caption)>*>* {
    background-color: transparent;
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* Dropdown Menu */
.dropdown-menu {
    background-color: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-item {
    color: #fff;
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* AI Assistant Widget Styles */
.ai-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    font-size: 24px;
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.ai-chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 500px;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ai-chat-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ai-message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.ai-message-assistant {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.ai-message-user {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.ai-chat-input-area {
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.typing-indicator {
    font-style: italic;
    opacity: 0.7;
}

/* Mobile Responsiveness for Chat */
@media (max-width: 480px) {
    .ai-chat-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .ai-fab {
        bottom: 20px;
        right: 20px;
    }
}

/* Demo Mode Styles */
.demo-signup-cta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.demo-badge {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.demo-features-list,
.premium-features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.demo-features-list li,
.premium-features-list li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.demo-features-list i {
    width: 16px;
}

.premium-features-list i {
    width: 16px;
}

.demo-banner {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 2rem;
    text-align: center;
    backdrop-filter: blur(10px);
}

.demo-banner h4 {
    margin-bottom: 0.5rem;
    color: #667eea;
}

.demo-banner p {
    margin-bottom: 1rem;
    opacity: 0.9;
}

/* Mobile responsiveness for demo elements */
@media (max-width: 768px) {
    .demo-signup-cta {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        margin-left: 0;
    }
    
    .demo-badge {
        text-align: center;
        align-self: center;
    }
    
    .navbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .nav-links {
        justify-content: center;
        flex-wrap: wrap;
    }
}