/* FIP Dashboard - Shared Components CSS */

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    padding: 20px 25px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 15px 25px;
    background: var(--light);
    border-radius: 0 0 12px 12px;
    text-align: center;
}

.close {
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Login Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--primary);
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 79, 139, 0.1);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: var(--dark);
    transform: translateY(-1px);
}

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

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

/* Notifications Modal Styles */
.notifications-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    padding: 15px;
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
    border-radius: 8px;
    margin-bottom: 10px;
}

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

.notification-item.unread {
    background: rgba(26, 79, 139, 0.05);
    border-left: 4px solid var(--primary);
}

.notification-icon {
    background: var(--primary);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
}

.notification-content h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: var(--primary);
}

.notification-content p {
    margin: 0 0 5px 0;
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
}

.notification-content small {
    color: #777;
    font-size: 11px;
}

/* User Menu Dropdown */
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    z-index: 1000;
    border: 1px solid var(--border);
    overflow: hidden;
}

.dropdown-header {
    padding: 15px;
    background: var(--light);
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
}

.dropdown-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border);
}

.dropdown-header div strong {
    display: block;
    font-size: 14px;
    color: var(--primary);
}

.dropdown-header div small {
    font-size: 12px;
    color: #777;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 5px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
}

.dropdown-item:hover {
    background: var(--light);
    color: var(--primary);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1001;
    min-width: 300px;
    border-left: 4px solid var(--primary);
    animation: toastSlideIn 0.3s ease-out;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-notification.success {
    border-left-color: var(--success);
}

.toast-notification.error {
    border-left-color: var(--danger);
}

.toast-notification.warning {
    border-left-color: var(--warning);
}

.toast-notification.info {
    border-left-color: var(--info);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
}

.toast-content i {
    font-size: 16px;
}

.toast-notification.success .toast-content i {
    color: var(--success);
}

.toast-notification.error .toast-content i {
    color: var(--danger);
}

.toast-notification.warning .toast-content i {
    color: var(--warning);
}

.toast-notification.info .toast-content i {
    color: var(--info);
}

.toast-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toast-close:hover {
    background: var(--light);
    color: var(--text);
}

/* Footer Styles */
.footer {
    background: var(--light);
    border-top: 1px solid var(--border);
    padding: 15px 0;
    margin-top: 40px;
    font-size: 13px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-left p {
    margin: 0;
    color: #666;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.footer-right span {
    color: #666;
}

.footer-right a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-right a:hover {
    color: var(--secondary);
}

/* Enhanced User Info Styles */
.user-info {
    position: relative;
}

.user-info .user {
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.user-info .user:hover {
    background: rgba(26, 79, 139, 0.1);
}

/* Responsive Modal Design */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .dropdown-menu {
        right: 10px;
        min-width: 200px;
    }
    
    .toast-notification {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Enhanced Search Bar */
#globalSearch {
    transition: all 0.3s ease;
}

#globalSearch:focus {
    box-shadow: 0 0 0 3px rgba(26, 79, 139, 0.1);
}

/* Notification Badge Animation */
.notification-badge {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .modal-content {
        border: 2px solid var(--text);
    }
    
    .btn {
        border: 2px solid currentColor;
    }
    
    .notification-item {
        border: 1px solid var(--border);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .modal-content,
    .toast-notification,
    .notification-badge {
        animation: none;
    }
    
    .loading::after {
        animation: none;
    }
    
    * {
        transition: none !important;
    }
}
