/* ==========================================================================
   CORNER IMMO - Admin Panel Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables
   -------------------------------------------------------------------------- */
:root {
    /* Login Theme */
    --login-primary-dark: #003756;
    --login-primary-accent: #c0f0f7;
    --login-primary-accent-hover: #09293f;
    --login-text-light: #c0f0f7;
    --login-text-muted: #a0a0a0;
    --login-card-bg: rgba(255, 255, 255, 0.03);
    --login-border-subtle: rgba(255, 255, 255, 0.08);
    --login-input-bg: rgba(255, 255, 255, 0.05);
    --login-shadow-glow: 0 0 60px rgba(192, 240, 247, 0.15);

    /* Brand Colors */
    --dark-blue: #003756;
    --medium-blue: #09293f;
    --light-blue: #c0f0f7;
    --white: #ffffff;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.sidebar {
    width: 220px;
    transition: width 0.3s ease;
    z-index: 1001;
}

.sidebar.collapsed {
    width: 70px;
}

/* Sidebar Header */
.sidebar-header {
    height: 60px;
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-logo {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--bs-primary) 0%, #0a58ca 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo i {
    font-size: 16px;
}

/* Nav Links */
.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    padding: 10px 12px;
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, var(--bs-primary) 0%, #0a58ca 100%);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
}

.sidebar-icon {
    width: 20px;
    text-align: center;
    margin-right: 12px;
    font-size: 1.1rem;
}

/* Sidebar Collapsed State */
.sidebar.collapsed .sidebar-text,
.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .sidebar-footer small {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center !important;
    padding: 15px 10px !important;
}

.sidebar.collapsed .sidebar-logo {
    margin-right: 0 !important;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .sidebar-icon {
    margin-right: 0;
    font-size: 1.25rem;
}

.sidebar.collapsed #sidebarToggle {
    display: none;
}

/* Sidebar Footer */
.sidebar-footer {
    font-size: 0.75rem;
}

/* ==========================================================================
   MAIN CONTENT
   ========================================================================== */
.main-content {
    margin-left: 220px;
    padding: 80px 30px 30px 30px;
    min-height: 100vh;
    background-color: #f8f9fa;
    transition: margin-left 0.3s ease;
}

/* Quand sidebar est collapsed */
.sidebar.collapsed ~ .main-content,
body.sidebar-collapsed .main-content {
    margin-left: 70px;
}

/* Page Header */
.page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.page-header .text-muted {
    font-size: 0.9rem;
}

/* ==========================================================================
   NAVBAR
   ========================================================================== */
#topNavbar {
    height: 60px;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* User Avatar */
.user-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--bs-primary) 0%, #0a58ca 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar-initials {
    color: white;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
}

/* User Dropdown */
#userDropdown {
    padding: 8px 12px;
    border-radius: 10px;
    transition: background-color 0.2s ease;
}

#userDropdown:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.dropdown-menu {
    border-radius: 12px;
    padding: 8px 0;
    min-width: 240px;
    margin-top: 8px;
}

.dropdown-item {
    border-radius: 6px;
    margin: 2px 8px;
    width: calc(100% - 16px);
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item.text-danger:hover {
    background-color: #fee2e2;
}

/* ==========================================================================
   LOGIN PAGE
   ========================================================================== */
body.login-page {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
    margin: 0;
}

/* Background animated gradient */
body.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
            radial-gradient(circle at 20% 80%, rgba(232, 197, 71, 0.03) 0%, transparent 50%),
            radial-gradient(circle at 80% 20%, rgba(232, 197, 71, 0.05) 0%, transparent 40%),
            radial-gradient(circle at 50% 50%, rgba(15, 52, 96, 0.3) 0%, transparent 60%);
    animation: loginBgFloat 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes loginBgFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-2%, -2%) rotate(1deg); }
}

/* Floating Geometric Shapes */
.geo-shape {
    position: absolute;
    opacity: 0.03;
    pointer-events: none;
}

.geo-shape-1 {
    top: 10%;
    left: 5%;
    width: 300px;
    height: 300px;
    border: 2px solid var(--login-primary-accent);
    transform: rotate(45deg);
    animation: geoFloat1 15s ease-in-out infinite;
}

.geo-shape-2 {
    bottom: 15%;
    right: 10%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 2px solid var(--login-primary-accent);
    animation: geoFloat2 12s ease-in-out infinite;
}

.geo-shape-3 {
    top: 60%;
    left: 15%;
    width: 150px;
    height: 150px;
    background: linear-gradient(45deg, transparent 48%, var(--login-primary-accent) 48%, var(--login-primary-accent) 52%, transparent 52%);
    animation: geoFloat3 18s ease-in-out infinite;
}

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

@keyframes geoFloat2 {
    0%, 100% { transform: scale(1) translateX(0); }
    50% { transform: scale(1.05) translateX(-15px); }
}

@keyframes geoFloat3 {
    0%, 100% { transform: rotate(0deg); opacity: 0.03; }
    50% { transform: rotate(5deg); opacity: 0.05; }
}

/* Login Container & Card */
.login-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 10;
}

.login-card {
    background: var(--login-card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--login-border-subtle);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: var(--login-shadow-glow);
    animation: loginCardAppear 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
}

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

/* Brand Section */
.brand-section {
    text-align: center;
    margin-bottom: 40px;
}

.brand-logo {
    width: 50%;
    height: 50%;
    background: linear-gradient(135deg, var(--login-primary-accent) 0%, var(--login-primary-accent-hover) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    padding: 10px;
}

.brand-logo i {
    font-size: 32px;
    color: var(--login-primary-dark);
}

.brand-title {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--login-text-light);
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.brand-subtitle {
    font-size: 14px;
    color: var(--login-text-muted);
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0;
}

/* Login Form Elements */
.form-group-login {
    margin-bottom: 24px;
    position: relative;
}

.form-label-login {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--light-blue);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.input-wrapper {
    position: relative;
}

.input-wrapper > i:first-of-type {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--login-text-muted);
    font-size: 18px;
    transition: color 0.3s ease;
    pointer-events: none;
}

.form-control-login {
    width: 100%;
    padding: 16px 50px 16px 52px;
    background: var(--login-input-bg);
    border: 1px solid var(--login-border-subtle);
    border-radius: 12px;
    font-size: 15px;
    color: var(--login-text-light);
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

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

.form-control-login:focus {
    outline: none;
    border-color: var(--login-primary-accent);
    background: rgba(232, 197, 71, 0.05);
    box-shadow: 0 0 0 4px rgba(232, 197, 71, 0.11);
}

.form-control-login:focus + i,
.form-group-login:focus-within .form-label-login {
    color: var(--login-primary-accent);
}

.form-group-login:focus-within .input-wrapper > i:first-of-type {
    color: var(--login-primary-accent);
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--login-text-muted);
    cursor: pointer;
    padding: 4px;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--login-primary-accent);
}

/* Forgot Password Link */
.forgot-link {
    display: block;
    text-align: right;
    font-size: 13px;
    color: var(--login-text-muted);
    text-decoration: none;
    margin-top: -16px;
    margin-bottom: 28px;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: var(--login-primary-accent);
}

/* Login Button */
.btn-login {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--login-primary-accent) 0%, var(--login-primary-accent) 100%);
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--login-primary-dark);
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login::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 ease;
}

.btn-login:hover {
    box-shadow: 0 10px 10px rgba(192, 240, 247, 0.15);
}

.btn-login:hover::before {
    left: 100%;
}

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

.btn-login i {
    transition: transform 0.3s ease;
}

.btn-login:hover i {
    transform: translateX(4px);
}

/* Login Button Loading State */
.btn-login.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-login.loading .btn-text,
.btn-login.loading > i {
    opacity: 0;
}

.btn-login .spinner {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid var(--login-primary-dark);
    border-top-color: transparent;
    border-radius: 50%;
    animation: loginSpin 0.8s linear infinite;
}

.btn-login.loading .spinner {
    display: block;
}

@keyframes loginSpin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Login Divider */
.login-divider {
    display: flex;
    align-items: center;
    margin: 32px 0;
    color: var(--login-text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--login-border-subtle);
}

.login-divider span {
    padding: 0 16px;
}

/* Help Text */
.help-text {
    text-align: center;
    font-size: 14px;
    color: var(--login-text-muted);
    margin: 0;
}

.help-text a {
    color: var(--login-primary-accent);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.help-text a:hover {
    text-decoration: underline;
}

/* Login Alerts */
.alert-login {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: alertSlide 0.4s ease;
}

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

.alert-login.alert-danger {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #ff6b7a;
}

.alert-login.alert-success {
    background: rgba(40, 167, 69, 0.15);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: #5dd879;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
    /* Navbar */
    #topNavbar .navbar-brand {
        width: 70px !important;
    }

    .user-avatar {
        width: 34px;
        height: 34px;
    }

    .avatar-initials {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    /* Login */
    .login-card {
        padding: 36px 28px;
        border-radius: 20px;
    }

    .brand-title {
        font-size: 24px;
    }

    .brand-logo {
        width: 60px;
        height: 60px;
    }

    .brand-logo i {
        font-size: 28px;
    }

    .geo-shape-1 {
        width: 200px;
        height: 200px;
    }

    .geo-shape-2 {
        width: 150px;
        height: 150px;
    }

    .geo-shape-3 {
        display: none;
    }
}

@media (max-width: 360px) {
    .login-card {
        padding: 28px 20px;
    }

    .form-control-login {
        padding: 14px 45px 14px 48px;
        font-size: 14px;
    }

    .btn-login {
        padding: 14px 20px;
        font-size: 14px;
    }
}