/**
 * Styles personnalisés - PHENIX BAT & TECH
 * Thème vert dégradé et jaune
 */

/* ============================================================================
   Variables et thème PHENIX
   ============================================================================ */
:root {
    --phenix-green-dark: #0d8a4d;
    --phenix-green: #10a05b;
    --phenix-green-light: #28c76f;
    --phenix-yellow: #ffd700;
    --phenix-orange: #ff9500;
    --primary-color: #10a05b;
    --secondary-color: #6c757d;
    --success-color: #28c76f;
    --danger-color: #dc3545;
    --warning-color: #ffd700;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #2c3e50;
    --gradient-green: linear-gradient(135deg, #0d8a4d 0%, #10a05b 50%, #28c76f 100%);
    --gradient-yellow-green: linear-gradient(135deg, #ffd700 0%, #10a05b 100%);
}

/* ============================================================================
   Layout général
   ============================================================================ */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.main-content {
    flex: 1;
    padding-top: 20px;
    padding-bottom: 40px;
}

/* ============================================================================
   Navigation PHENIX
   ============================================================================ */
.navbar-phenix {
    background: var(--gradient-green) !important;
    box-shadow: 0 2px 15px rgba(16, 160, 91, 0.3);
    padding: 0.5rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    white-space: nowrap;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-brand img {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.brand-text {
    background: linear-gradient(135deg, #fff 0%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    letter-spacing: 0.5px;
    font-size: 0.95rem;
}

.navbar-nav .nav-link {
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0.7rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--phenix-yellow);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 80%;
}

.navbar-nav .nav-link:hover {
    transform: translateY(-2px);
    color: var(--phenix-yellow) !important;
}

/* Navbar items spacing */
.navbar-nav .nav-item {
    margin: 0 0.1rem;
}

/* Container fluide pour éviter débordement */
.navbar .container {
    max-width: 100%;
    padding: 0 15px;
}

/* Responsive navbar */
@media (max-width: 1400px) {
    .brand-text {
        font-size: 0.85rem;
        letter-spacing: 0;
    }
    
    .navbar-nav .nav-link {
        font-size: 0.85rem;
        padding: 0.5rem 0.5rem;
    }
    
    .navbar-brand img {
        height: 35px !important;
    }
}

@media (max-width: 1200px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .brand-text {
        display: none; /* Cacher le texte sur petits écrans */
    }
    
    .navbar-nav .nav-link {
        font-size: 0.8rem;
        padding: 0.5rem 0.4rem;
    }
}

@media (max-width: 992px) {
    .navbar-collapse {
        margin-top: 1rem;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .navbar-nav {
        width: 100%;
    }
    
    .navbar-nav .nav-item {
        margin: 0.25rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    .navbar-nav .nav-link::after {
        display: none;
    }
}

/* ============================================================================
   Cards et conteneurs
   ============================================================================ */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    box-shadow: 0 2px 8px rgba(16, 160, 91, 0.1);
    border-radius: 12px;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(16, 160, 91, 0.2);
}

.card-header.bg-primary {
    background: var(--gradient-green) !important;
    border: none;
}

.card-img-top {
    height: 200px;
    object-fit: cover;
}

/* ============================================================================
   Plan de masse
   ============================================================================ */
#plan-container {
    position: relative;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

#plan-svg {
    width: 100%;
    height: auto;
    max-height: 600px;
}

#plan-svg path,
#plan-svg polygon {
    cursor: pointer;
    stroke: #fff;
    stroke-width: 2;
    transition: all 0.3s ease;
}

#plan-svg path:hover,
#plan-svg polygon:hover {
    stroke-width: 3;
    opacity: 0.8;
}

.unit-free {
    fill: var(--success-color);
}

.unit-reserved {
    fill: var(--warning-color);
}

.unit-sold {
    fill: var(--danger-color);
}

.plan-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.plan-filters {
    margin-bottom: 20px;
}

/* ============================================================================
   Visite 360°
   ============================================================================ */
#panorama-container {
    width: 100%;
    height: 500px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.tour-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.tour-item {
    cursor: pointer;
    transition: all 0.3s ease;
}

.tour-item:hover {
    transform: scale(1.05);
}

.tour-thumbnail {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

/* ============================================================================
   Tickets SAV
   ============================================================================ */
.ticket-card {
    border-left: 4px solid var(--primary-color);
    margin-bottom: 15px;
}

.ticket-card.priority-urgent {
    border-left-color: var(--danger-color);
}

.ticket-card.priority-high {
    border-left-color: var(--warning-color);
}

.ticket-card.priority-normal {
    border-left-color: var(--info-color);
}

.ticket-card.priority-low {
    border-left-color: var(--secondary-color);
}

.ticket-timeline {
    position: relative;
    padding-left: 40px;
}

.ticket-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.timeline-item {
    position: relative;
    padding-bottom: 30px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -32px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--primary-color);
}

.timeline-comment {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

.timeline-comment.internal {
    background: #fff3cd;
    border-left: 3px solid var(--warning-color);
}

.comment-attachments {
    margin-top: 10px;
}

.attachment-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: #e9ecef;
    border-radius: 4px;
    margin-right: 10px;
    margin-bottom: 10px;
    text-decoration: none;
    color: var(--dark-color);
    transition: all 0.3s ease;
}

.attachment-item:hover {
    background: #dee2e6;
    transform: translateY(-2px);
}

/* ============================================================================
   Dashboard & Stats
   ============================================================================ */
.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.stat-card.success {
    background: linear-gradient(135deg, var(--success-color), #20c997);
}

.stat-card.warning {
    background: linear-gradient(135deg, var(--warning-color), #fd7e14);
}

.stat-card.danger {
    background: linear-gradient(135deg, var(--danger-color), #c82333);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(16, 160, 91, 0.1), transparent);
    transition: left 0.5s ease;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 40px rgba(16, 160, 91, 0.3) !important;
}

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

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* ============================================================================
   Filtres et recherche
   ============================================================================ */
.filter-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.search-box {
    position: relative;
}

.search-box .bi-search {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.search-box input {
    padding-left: 40px;
}

/* ============================================================================
   Badges personnalisés
   ============================================================================ */
.badge {
    padding: 6px 12px;
    font-weight: 600;
    border-radius: 6px;
}

.badge.bg-success {
    background: var(--phenix-green-light) !important;
}

.badge.bg-warning {
    background: var(--phenix-yellow) !important;
    color: #2c3e50;
}

.badge.bg-primary {
    background: var(--phenix-green) !important;
}

/* ============================================================================
   Formulaires
   ============================================================================ */
.form-label {
    font-weight: 600;
    color: var(--dark-color);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--phenix-green);
    box-shadow: 0 0 0 0.25rem rgba(16, 160, 91, 0.25);
}

/* ============================================================================
   Tables
   ============================================================================ */
.table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.table thead {
    background: var(--gradient-green);
    color: white;
}

.table thead th {
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table-hover tbody tr:hover {
    background-color: rgba(16, 160, 91, 0.05);
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(16, 160, 91, 0.02);
}

/* ============================================================================
   Breadcrumb
   ============================================================================ */
.breadcrumb {
    background: rgba(16, 160, 91, 0.1);
    border-radius: 8px;
    padding: 12px 20px;
}

.breadcrumb-item.active {
    color: var(--phenix-green);
    font-weight: 600;
}

.breadcrumb-item a {
    color: var(--phenix-green);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: var(--phenix-yellow);
}

/* ============================================================================
   Alerts avec style PHENIX
   ============================================================================ */
.alert {
    border: none;
    border-left: 4px solid;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.alert-success {
    background-color: rgba(40, 199, 111, 0.1);
    border-left-color: var(--phenix-green-light);
    color: var(--phenix-green-dark);
}

.alert-warning {
    background-color: rgba(255, 215, 0, 0.1);
    border-left-color: var(--phenix-yellow);
    color: #856404;
}

.alert-info {
    background-color: rgba(16, 160, 91, 0.1);
    border-left-color: var(--phenix-green);
}

/* ============================================================================
   Pagination
   ============================================================================ */
.pagination {
    margin-top: 30px;
}

.pagination .page-link {
    color: var(--phenix-green);
    border-color: #dee2e6;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background-color: var(--phenix-green-light);
    border-color: var(--phenix-green);
    color: white;
}

.pagination .page-item.active .page-link {
    background: var(--gradient-green);
    border-color: var(--phenix-green);
}

/* ============================================================================
   Modals
   ============================================================================ */
.modal-content {
    border: none;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.modal-header {
    background: var(--primary-color);
    color: white;
    border-radius: 8px 8px 0 0;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* ============================================================================
   Alertes
   ============================================================================ */
.alert {
    border: none;
    border-left: 4px solid;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ============================================================================
   Hero section
   ============================================================================ */
/* Style de base pour hero-section - pas de fond, vidéo visible */
.hero-section {
    background: transparent;
    padding: 80px 0;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-weight: 800;
}

.hero-section .lead {
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* ============================================================================
   Hero Slider Section
   ============================================================================ */
.hero-slider-section {
    position: relative;
    overflow: hidden;
}

.hero-section {
    background: transparent;
    color: white;
    padding: 120px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pas de fond coloré pour les slides - la vidéo est visible */
.hero-slide-1,
.hero-slide-2,
.hero-slide-3,
.hero-slide-4 {
    background: transparent;
}

/* Pas d'effet de particules - la vidéo est visible */
.hero-section::before {
    display: none;
}

/* Contrôles du carousel */
.carousel-control-prev,
.carousel-control-next {
    width: 5%;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 3rem;
    height: 3rem;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    padding: 10px;
}

/* Indicateurs du carousel */
.carousel-indicators {
    bottom: 20px;
}

.carousel-indicators [data-bs-target] {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 5px;
    background-color: rgba(255, 255, 255, 0.5);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.carousel-indicators .active {
    background-color: #ffd700;
    transform: scale(1.3);
    border-color: white;
}

/* Transitions du carousel */
.carousel-fade .carousel-item {
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.carousel-fade .carousel-item.active {
    opacity: 1;
}

/* Animation Animate.css - ajout local */
.animate__animated {
    animation-duration: 1s;
    animation-fill-mode: both;
}

.animate__fadeInDown {
    animation-name: fadeInDown;
}

.animate__fadeInUp {
    animation-name: fadeInUp;
}

.animate__pulse {
    animation-name: pulse;
    animation-duration: 2s;
    animation-iteration-count: infinite;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -100%, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 100%, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        padding: 80px 0;
        min-height: 500px;
    }
    
    .carousel-control-prev,
    .carousel-control-next {
        width: 10%;
    }
}

/* ============================================================================
   Responsive
   ============================================================================ */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    #plan-container {
        padding: 10px;
    }
    
    #panorama-container {
        height: 300px;
    }
}

/* ============================================================================
   Animations et effets
   ============================================================================ */
.stat-card {
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(16, 160, 91, 0.1), transparent);
    transition: left 0.5s ease;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 40px rgba(16, 160, 91, 0.3) !important;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* ============================================================================
   Print
   ============================================================================ */
@media print {
    .navbar,
    .footer,
    .btn,
    .no-print {
        display: none !important;
    }
}

/* ============================================================================
   Footer PHENIX Compact
   ============================================================================ */
.footer-phenix-compact {
    background: linear-gradient(135deg, #0d8a4d 0%, #1a1a2e 100%);
    position: relative;
    overflow: hidden;
    border-top: 3px solid var(--phenix-yellow);
}

.footer-logo {
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.footer-logo:hover {
    transform: scale(1.1) rotate(5deg);
}

.footer-location {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.footer-location i {
    font-size: 1.1rem;
}

/* Liens de navigation footer */
.footer-nav .list-inline-item {
    margin: 0 5px;
}

.footer-link-simple {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
}

.footer-link-simple:hover {
    color: var(--phenix-yellow);
    text-decoration: underline;
}

/* Contact icons */
.footer-contact-link {
    display: inline-block;
    width: 35px;
    height: 35px;
    line-height: 35px;
    text-align: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.footer-contact-link:hover {
    background: var(--phenix-yellow);
    color: #2c3e50;
    transform: translateY(-3px);
}

/* Icônes réseaux sociaux */
.footer-social {
    margin-top: 10px;
}

.footer-social-icon {
    display: inline-block;
    width: 35px;
    height: 35px;
    line-height: 35px;
    text-align: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    margin: 0 4px;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.footer-social-icon:hover {
    background: var(--phenix-yellow);
    color: #2c3e50;
    transform: translateY(-5px) rotate(360deg);
}

/* Bottom bar */
.footer-bottom {
    border-top: 1px solid rgba(255, 215, 0, 0.2);
}

/* Bouton retour en haut */
.btn-back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient-green);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(16, 160, 91, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    display: none;
}

.btn-back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 25px rgba(16, 160, 91, 0.6);
}

.btn-back-to-top.show {
    display: block;
    animation: fadeInUp 0.3s ease;
}

/* Responsive footer */
@media (max-width: 768px) {
    .footer-nav .list-inline-item {
        display: block;
        margin: 5px 0;
    }
    
    .footer-nav .list-inline-item:not(:last-child)::after {
        content: none;
    }
    
    .footer-contact-link,
    .footer-social-icon {
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 1.2rem;
    }
}

/* RTL Support */
html[dir="rtl"] {
    direction: rtl;
}

html[dir="rtl"] .navbar-nav {
    flex-direction: row-reverse;
}

html[dir="rtl"] .text-start {
    text-align: right !important;
}

html[dir="rtl"] .text-end {
    text-align: left !important;
}

html[dir="rtl"] .me-2,
html[dir="rtl"] .me-3 {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

html[dir="rtl"] .ms-2,
html[dir="rtl"] .ms-3 {
    margin-left: 0 !important;
    margin-right: 0.5rem !important;
}

/* ============================================================================
   AMÉLIORATIONS CONSIDÉRABLES - UX & DESIGN MODERNE
   ============================================================================ */

/* --- Smooth Page Transitions --- */
.main-content {
    animation: pageLoad 0.4s ease-out;
}

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

/* --- Enhanced Button Styles --- */
.btn {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--gradient-green);
    border: none;
    box-shadow: 0 4px 15px rgba(16, 160, 91, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 160, 91, 0.4);
    background: var(--gradient-green);
    filter: brightness(1.1);
}

.btn-outline-primary {
    color: var(--phenix-green);
    border-color: var(--phenix-green);
}

.btn-outline-primary:hover {
    background: var(--gradient-green);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 160, 91, 0.3);
}

/* --- Loading Spinner for AJAX --- */
.btn-loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btnSpin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

/* --- Enhanced Form Styles --- */
.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 0.6rem 1rem;
    transition: all 0.3s ease;
}

.form-control:hover, .form-select:hover {
    border-color: rgba(16, 160, 91, 0.4);
}

.form-control:focus, .form-select:focus {
    border-color: var(--phenix-green);
    box-shadow: 0 0 0 0.2rem rgba(16, 160, 91, 0.15);
}

/* Floating label enhancement */
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--phenix-green);
}

/* --- Password Strength Indicator --- */
.password-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 8px;
    background: #e9ecef;
    overflow: hidden;
    transition: all 0.3s ease;
}

.password-strength .strength-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s ease, background 0.4s ease;
    width: 0;
}

.password-strength .strength-bar.weak { width: 25%; background: #dc3545; }
.password-strength .strength-bar.fair { width: 50%; background: #fd7e14; }
.password-strength .strength-bar.good { width: 75%; background: #ffc107; }
.password-strength .strength-bar.strong { width: 100%; background: #28c76f; }

.password-strength-text {
    font-size: 0.75rem;
    margin-top: 4px;
    font-weight: 600;
}

/* --- Enhanced Card Styles --- */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Prevent excessive card hover on forms */
.card:has(form):hover,
.card.no-hover:hover {
    transform: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.card-header {
    border-bottom: none;
    font-weight: 600;
    padding: 1rem 1.25rem;
}

/* --- Glassmorphism Effect for Special Cards --- */
.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* --- Enhanced Stat Cards with Counter Animation --- */
.stat-card {
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    cursor: default;
}

.stat-card .stat-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3.5rem;
    opacity: 0.15;
}

.stat-card .stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.2);
    margin-top: 8px;
}

/* --- Enhanced Table Styles --- */
.table {
    border-radius: 12px;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    padding: 14px 16px;
    font-size: 0.8rem;
    letter-spacing: 0.8px;
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: rgba(16, 160, 91, 0.04);
    transform: none;
    box-shadow: none;
}

/* Table actions column */
.table .actions-col {
    white-space: nowrap;
}

.table .actions-col .btn {
    padding: 4px 8px;
    font-size: 0.8rem;
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
}

.custom-toast {
    background: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideIn 0.4s ease;
    max-width: 400px;
    border-left: 4px solid;
}

.custom-toast.toast-success { border-left-color: #28c76f; }
.custom-toast.toast-error { border-left-color: #dc3545; }
.custom-toast.toast-warning { border-left-color: #ffc107; }
.custom-toast.toast-info { border-left-color: #17a2b8; }

.custom-toast.toast-hide {
    animation: toastSlideOut 0.3s ease forwards;
}

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

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

/* --- Skeleton Loading --- */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-card {
    height: 200px;
}

@keyframes skeletonShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* --- Enhanced Alert Styles with Animation --- */
.alert {
    border-radius: 12px;
    padding: 16px 20px;
    animation: alertSlideDown 0.3s ease;
}

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

/* --- Scroll Progress Bar --- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--gradient-yellow-green);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* --- Enhanced Badge Styles --- */
.badge {
    font-size: 0.75rem;
    letter-spacing: 0.3px;
}

.badge-pulse {
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(40, 199, 111, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(40, 199, 111, 0); }
}

/* --- Enhanced Login Card --- */
.login-card {
    max-width: 450px;
    margin: 0 auto;
}

.login-card .card-body {
    padding: 2.5rem !important;
}

.login-card .input-group-text {
    background: transparent;
    border-right: none;
}

.login-card .input-group .form-control {
    border-left: none;
}

.login-card .input-group:focus-within .input-group-text {
    border-color: var(--phenix-green);
    color: var(--phenix-green);
}

/* --- Floating Action Buttons --- */
.fab-container {
    position: fixed;
    bottom: 90px;
    right: 30px;
    z-index: 999;
}

.fab-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-green);
    border: none;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 20px rgba(16, 160, 91, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.fab-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(16, 160, 91, 0.5);
}

/* --- Improved Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--phenix-green-light), var(--phenix-green));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--phenix-green-dark);
}

/* --- Empty State Styles --- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 20px;
}

.empty-state h4 {
    font-weight: 600;
    margin-bottom: 10px;
}

.empty-state p {
    max-width: 400px;
    margin: 0 auto 20px;
}

/* --- Image Gallery Lightbox Enhancement --- */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
}

.gallery-item img {
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-item .gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    background: rgba(0, 0, 0, 0.4);
}

.gallery-overlay i {
    color: white;
    font-size: 2rem;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-overlay i {
    opacity: 1;
    transform: scale(1);
}

/* --- Notification Dot --- */
.notification-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: #dc3545;
    border-radius: 50%;
    border: 2px solid white;
    animation: notifPulse 2s infinite;
}

@keyframes notifPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* --- Smooth Link Transitions --- */
a {
    transition: color 0.2s ease;
}

/* --- Enhanced Dropdown --- */
.dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    padding: 8px;
    animation: dropdownFade 0.2s ease;
}

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

.dropdown-item {
    border-radius: 8px;
    padding: 8px 16px;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(16, 160, 91, 0.08);
    color: var(--phenix-green);
}

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

/* --- Accessible Focus Styles --- */
:focus-visible {
    outline: 2px solid var(--phenix-green);
    outline-offset: 2px;
    border-radius: 4px;
}

.btn:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(16, 160, 91, 0.5);
}

/* --- Reduced Motion Support --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .main-content {
        animation: none;
    }
}

/* --- Dark Mode Support --- */
@media (prefers-color-scheme: dark) {
    :root {
        --phenix-bg: #1a1a2e;
        --phenix-card-bg: #16213e;
        --phenix-text: #e0e0e0;
        --phenix-border: #2c3e50;
    }
}

/* --- Better Print Styles --- */
@media print {
    .navbar, .footer, .btn, .no-print,
    .fab-container, .btn-back-to-top,
    .scroll-progress, .toast-container {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd;
    }
    
    body {
        color: #000;
        background: #fff;
    }
}
