/**
 * UI Fixes for Hotel Management System
 * Fixes for login icons, dropdowns, positioning, and other visual issues
 */

/* ===== LOGIN PAGE ICONS FIX ===== */
.premium-input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.25rem;
    pointer-events: none;
    z-index: 1;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.premium-input:focus+.premium-input-icon {
    color: var(--primary-color);
}

.premium-input-wrapper.error .premium-input-icon {
    color: var(--danger-color);
}

/* Ensure Material Icons are loaded */
.material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== USER DROPDOWN MENU ENHANCEMENTS ===== */
.user-dropdown-menu {
    min-width: 280px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    margin-top: 0.5rem;
    animation: dropdownSlide 0.3s ease-out;
    overflow: hidden;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-user-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
}

.dropdown-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.dropdown-user-info .dropdown-user-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.dropdown-user-info .dropdown-user-role {
    font-size: 0.8rem;
    opacity: 0.9;
}

.user-dropdown-menu .dropdown-item {
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    border: none;
    color: var(--text-main);
}

.user-dropdown-menu .dropdown-item:hover {
    background: var(--bg-body);
    color: var(--primary-color);
    transform: translateX(2px);
}

.user-dropdown-menu .dropdown-item i {
    font-size: 1.1rem;
    opacity: 0.8;
}

.user-dropdown-menu .dropdown-item:hover i {
    opacity: 1;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: var(--border-color);
}

/* ===== CONNECTION STATUS POSITIONING FIX ===== */
.connection-status {
    position: fixed;
    bottom: 90px;
    right: 2rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 0.75rem 1.25rem;
    box-shadow: var(--shadow-md);
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.connection-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

.connection-status.connected {
    background: rgba(34, 197, 94, 0.1);
    color: var(--secondary-color);
    border-color: rgba(34, 197, 94, 0.2);
}

.connection-status.disconnected {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border-color: rgba(239, 68, 68, 0.2);
}

.connection-status.connecting {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-color);
    border-color: rgba(245, 158, 11, 0.2);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ===== WELCOME SECTION BACKGROUND FIX ===== */
.welcome-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: var(--border-radius-lg);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.welcome-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="welcome-pattern" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23welcome-pattern)"/></svg>');
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

.welcome-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.welcome-section p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.role-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ===== NOTIFICATION COUNT POSITIONING FIX ===== */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: bounce 2s infinite;
    z-index: 10;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-4px);
    }
    60% {
        transform: translateY(-2px);
    }
}

.notification-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#headerNotificationCount {
    background: var(--primary-color);
    color: white;
    border-radius: 0.25rem;
    padding: 0.125rem 0.375rem;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: auto;
    min-width: 20px;
    text-align: center;
}

/* ===== PREMIUM DROPDOWN ENHANCEMENTS ===== */
.premium-dropdown {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.notification-dropdown {
    min-width: 320px;
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
    cursor: pointer;
}

.notification-item:hover {
    background: var(--bg-body);
}

.notification-item.unread {
    background: rgba(59, 130, 246, 0.05);
    border-left: 3px solid var(--info-color);
}

.notification-item:last-child {
    border-bottom: none;
}

/* ===== FORM ENHANCEMENTS ===== */
.premium-input-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

.premium-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
}

.premium-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.1);
}

.premium-input-wrapper.password-toggle .premium-input {
    padding-right: 3rem;
}

.premium-password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.premium-password-toggle:hover {
    background: var(--bg-body);
    color: var(--primary-color);
}

/* ===== RESPONSIVE FIXES ===== */
@media (max-width: 768px) {
    .connection-status {
        top: 80px;
        right: 1rem;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .user-dropdown-menu {
        min-width: 250px;
        margin-right: 1rem;
    }
    
    .welcome-section {
        padding: 2rem 1.5rem;
        margin: 0 1rem 1.5rem 1rem;
    }
    
    .welcome-section h2 {
        font-size: 2rem;
    }
    
    .welcome-section p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .connection-status {
        position: relative;
        top: auto;
        right: auto;
        margin: 1rem;
        display: inline-flex;
    }
    
    .notification-badge {
        width: 16px;
        height: 16px;
        font-size: 0.65rem;
    }
}

/* ===== GENERAL UI ENHANCEMENTS ===== */
.btn {
    transition: all 0.2s ease;
    border-radius: var(--border-radius);
    font-weight: 500;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-success {
    background: var(--secondary-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-secondary {
    background: var(--text-muted);
    color: white;
}

.card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    background: white;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--text-main);
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--secondary-color);
    border-left: 4px solid var(--secondary-color);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-color);
    border-left: 4px solid var(--accent-color);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
    border-left: 4px solid var(--info-color);
}

.modal {
    border-radius: var(--border-radius-lg);
}

.modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem;
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
}

.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: var(--text-main);
    background: var(--bg-body);
}

.table td {
    vertical-align: middle;
    color: var(--text-main);
}

.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.75rem;
}

.badge-primary {
    background: var(--primary-color);
    color: white;
}

.badge-success {
    background: var(--secondary-color);
    color: white;
}

.badge-danger {
    background: var(--danger-color);
    color: white;
}

.badge-warning {
    background: var(--accent-color);
    color: white;
}

.badge-info {
    background: var(--info-color);
    color: white;
}

/* ===== FORM ENHANCEMENTS ===== */
.form-control {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

/* ===== METRIC CARDS ===== */
.metric-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.metric-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.metric-card p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.9rem;
}

.metric-card.bookings h3 {
    color: var(--primary-color);
}

.metric-card.confirmed h3 {
    color: var(--secondary-color);
}

.metric-card.cancelled h3 {
    color: var(--danger-color);
}

.metric-card.conversion h3 {
    color: var(--accent-color);
}

/* ===== CHART CONTAINERS ===== */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* ===== TABLE RESPONSIVE ===== */
.table-responsive {
    border-radius: var(--border-radius);
    overflow: hidden;
}

/* ===== LOADING STATES ===== */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
