﻿:root {
    --login-primary-color: #1a3a6e; /* Dark Blue from your dashboard */
    --login-secondary-color: #007bff; /* Lighter Blue for buttons */
    --login-text-light: #f8f9fa;
    --login-text-dark: #333;
    --login-border-color: #ced4da;
    --login-error-color: #dc3545;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;    
}

.login-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

.login-left {
    flex: 1;
    background-color: var(--login-primary-color);
    color: var(--login-text-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-sizing: border-box;
    text-align: center;
}

.login-left-content {
    max-width: 400px;
}

.login-logo {
    max-width: 150px;
    margin-bottom: 20px;
}

.login-left h1 {
    font-size: 2.2em;
    margin-bottom: 10px;
}

.login-left p {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 30px;
}

/* Simple animation for dots */
.animated-dots {
    display: flex;
    justify-content: center;
    align-items: center;
}

    .animated-dots span {
        display: inline-block;
        width: 12px;
        height: 12px;
        background-color: var(--login-secondary-color);
        border-radius: 50%;
        margin: 0 5px;
        animation: pulse 1.5s infinite ease-in-out;
    }

        .animated-dots span:nth-child(1) {
            animation-delay: 0s;
        }

        .animated-dots span:nth-child(2) {
            animation-delay: 0.2s;
        }

        .animated-dots span:nth-child(3) {
            animation-delay: 0.4s;
        }

@keyframes pulse {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.login-right {
    flex: 1;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-sizing: border-box;
}

.login-form-wrapper {
    width: 100%;
    max-width: 400px; /* Max width for the form itself */
}

    .login-form-wrapper h2 {
        font-size: 1.8em;
        color: var(--login-text-dark);
        margin-bottom: 5px;
        text-align: center;
    }

    .login-form-wrapper p {
        font-size: 1em;
        color: #6c757d;
        margin-bottom: 30px;
        text-align: center;
    }

.form-group {
    margin-bottom: 20px;
}

    .form-group label {
        display: block;
        font-weight: 600;
        margin-bottom: 8px;
        color: #495057;
        font-size: 0.9em;
    }

.form-control {
    width: 100%;
    padding: 12px 15px;
    font-size: 1em;
    border: 1px solid var(--login-border-color);
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

    .form-control:focus {
        border-color: var(--login-secondary-color);
        outline: 0;
        box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
    }

.btn-login {
    width: 100%;
    padding: 12px 15px;
    font-size: 1em;
    font-weight: 600;
    color: #fff;
    background-color: var(--login-primary-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

    .btn-login:hover {
        background-color: #0d2857; /* Darker shade of primary */
    }

    .danger {background-color:red;
    }

.error-message {
    display: block;
    color: var(--login-error-color);
    font-size: 0.9em;
    margin-top: 15px;
    text-align: center;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px); /* Position below the icon with a small gap */
    right: 0;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1010;
    min-width: 220px; /* Minimum width for dropdowns */
    max-width: 300px; /* Max width for notifications */
    padding: 0;
    display: none; /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

    .dropdown-menu.show {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .dropdown-menu .dropdown-header {
        padding: 10px 15px;
        font-weight: 600;
        color: #555;
        font-size: 0.9em;
        border-bottom: 1px solid #f0f0f0;
    }

    .dropdown-menu .dropdown-item {
        display: flex; /* For icon and text alignment */
        align-items: center;
        padding: 10px 15px;
        color: #333;
        text-decoration: none;
        white-space: nowrap; /* Prevent text wrapping */
        font-size: 0.9em;
        transition: background-color 0.15s ease;
    }

        .dropdown-menu .dropdown-item:hover {
            background-color: #f8f9fa;
            color: var(--primary-color);
        }

        .dropdown-menu .dropdown-item i { /* For icons within dropdown items */
            margin-right: 10px;
            color: #777;
            width: 16px; /* Align icons */
            text-align: center;
        }

        .dropdown-menu .dropdown-item:hover i {
            color: var(--primary-color);
        }


/* Notification dropdown specific */
.notification-dropdown .dropdown-item {
    align-items: flex-start; /* For multi-line content */
    white-space: normal; /* Allow wrapping for notification text */
}

.notification-dropdown .item-icon {
    margin-right: 10px;
    font-size: 1.2em;
    color: var(--secondary-color);
    padding-top: 2px;
}

.notification-dropdown .item-content {
    flex-grow: 1;
}

.notification-dropdown .item-title {
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
    line-height: 1.3;
}

.notification-dropdown .item-meta {
    font-size: 0.8em;
    color: #777;
}

.notification-dropdown .dropdown-footer {
    padding: 8px 15px;
    text-align: center;
    font-size: 0.85em;
    border-top: 1px solid #f0f0f0;
}

    .notification-dropdown .dropdown-footer a {
        color: var(--secondary-color);
        text-decoration: none;
        font-weight: 500;
    }

/* Profile dropdown specific */
.profile-dropdown .dropdown-profile-info {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.profile-dropdown .dropdown-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.profile-dropdown .dropdown-user-details {
    display: flex;
    flex-direction: column;
}

    .profile-dropdown .dropdown-user-details .username {
        font-weight: 600;
        color: #333;
        font-size: 0.95em;
    }

    .profile-dropdown .dropdown-user-details .user-role {
        font-size: 0.8em;
        color: #777;
    }

/* Custom Select Dropdown - Keyboard Navigation Highlight */
.custom-select-options .custom-option.key-highlighted {
    background-color: #d4eaff; /* A light blue for keyboard focus */
}

.custom-select-options .custom-option.selected { /* Ensure selected keeps its style priority */
    background-color: var(--secondary-color) !important;
    color: white !important;
}


/* Responsive Adjustments */
@media (max-width: 992px) {
    /* When sidebar is 'open' on mobile, it should not be 'collapsed' style */
    .sidebar.open {
        width: 240px !important; /* Override collapsed width */
    }

        .sidebar.open .sidebar-link-text {
            display: inline !important; /* Override collapsed display:none */
        }

        .sidebar.open nav ul li a {
            justify-content: flex-start !important; /* Override collapsed justify-content */
        }

            .sidebar.open nav ul li a i {
                margin-right: 12px !important;
                font-size: 1.1em !important; /* Restore margin */
            }

    .main-content-wrapper.sidebar-collapsed .main-content {
        margin-left: 15px; /* On mobile, when sidebar is hidden, main content takes full space */
    }

    .main-content-wrapper .main-content {
        margin-left: 15px; /* Default for mobile if sidebar is closed */
    }
    /* If sidebar.open, main-content needs to not overlap if sidebar is not an overlay */
    body.mobile-sidebar-open .main-content {
        /* If your mobile sidebar pushes content, adjust margin here. */
        /* If it overlays, no change needed. Current CSS makes it an overlay. */
    }
}

/* Ensure menu toggle is always visible for desktop collapse too */
.menu-toggle {
    display: block; /* Make it always visible */
}

@media (max-width: 768px) {
    /* For smaller screens, dropdowns might need to be wider or positioned differently */
    .dropdown-menu {
        z-index: 1010;
    }
    /* Hide the Meridean Overseas Logo text next to actual logo if sidebar is collapsed */
    .logo-area span {
        transition: opacity 0.3s ease, width 0.3s ease, margin-left 0.3s ease;
    }

    .sidebar.collapsed + .main-content-wrapper .logo-area span, /* This selector is tricky with current DOM */
    body.sidebar-collapsed .logo-area span { /* if body gets class */
        opacity: 0;
        width: 0;
        overflow: hidden;
        margin-left: -10px; /* Pull it back */
    }
}


/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
    }

    .login-left, .login-right {
        flex: none; /* Disable flex grow/shrink */
        width: 100%;
        min-height: 50vh; /* Give each section some height */
        padding: 30px;
    }

    .login-left {
        order: 2; /* Show form first on mobile by default, or keep as 1 */
    }

    .login-right {
        order: 1;
        overflow-y: auto; /* Allow scrolling if form is too long */
    }


    .login-left h1 {
        font-size: 1.8em;
    }

    .login-left p {
        font-size: 1em;
    }

    .login-form-wrapper h2 {
        font-size: 1.6em;
    }
}

@media (max-width: 480px) {
    .login-left, .login-right {
        padding: 20px;
    }

    .form-control, .btn-login {
        padding: 10px 12px;
        font-size: 0.9em;
    }

    .login-logo {
        max-width: 100px;
    }
}
