/* ============================================
   PKG Pushp Kunj Globe - Theme Custom CSS
   Colors Contrasting with Logo (Dark & Light Green)
   Adding Animations & Beautiful UI
   ============================================ */

:root {
    /* Logo Colors - Dark Green (continents) & Light Green (ocean/ring) */
    --logo-dark-green: #2d5016;      /* Dark green from logo */
    --logo-light-green: #7cb342;     /* Light green from logo */
    
    /* Primary Colors - Contrasting with Logo */
    --primary-green: #4caf50;         /* Balanced green for buttons */
    --primary-green-dark: #2d5016;    /* Dark green matching logo */
    --primary-green-light: #81c784;   /* Light green matching logo */
    --primary-green-hover: #66bb6a;   /* Hover state */
    --primary-green-subtle: rgba(124, 179, 66, 0.1);  /* Subtle background */
    --primary-green-border: rgba(124, 179, 66, 0.3);  /* Border color */
    
    /* Background Colors - Contrasting with Logo */
    --bg-primary: #f5f5f5;            /* Light off-white like logo bg */
    --bg-secondary: #ffffff;         /* Pure white */
    --bg-dark: #1a1a1a;             /* Dark background for contrast */
    --bg-sidebar: #2d2d2d;          /* Dark sidebar */
    
    /* Text Colors */
    --text-primary: #2d5016;         /* Dark green text */
    --text-secondary: #666666;       /* Gray text */
    --text-light: #ffffff;           /* White text */
    
    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================
   Primary Color Replacements
   ============================================ */

/* Buttons - Only Primary Button Green */
.btn-primary,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
    background-color: var(--primary-green) !important;
    border-color: var(--primary-green-dark) !important;
    color: #ffffff !important;
    font-weight: 600;
    transition: var(--transition-smooth);
    box-shadow: 0 2px 8px rgba(124, 179, 66, 0.4);
}

.btn-primary:hover {
    background-color: var(--primary-green-dark) !important;
    border-color: var(--primary-green-dark) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 80, 22, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 255, 0, 0.3);
}

/* Other buttons keep their original colors - no overrides */

/* Primary Text Colors */
.text-primary {
    color: var(--primary-green) !important;
}

/* Primary Backgrounds */
.bg-primary,
.bg-primary-subtle {
    background-color: var(--primary-green-subtle) !important;
}

/* Primary Borders */
.border-primary {
    border-color: var(--primary-green) !important;
}

/* Links */
a.text-primary,
a.text-primary:hover {
    color: var(--primary-green) !important;
}

/* ============================================
   Sidebar Styling
   ============================================ */

.sidebar {
    background: linear-gradient(180deg, var(--bg-sidebar) 0%, #1a1a1a 100%);
    border-right: 3px solid var(--logo-light-green);
    box-shadow: 4px 0 20px rgba(124, 179, 66, 0.2);
}

.side-nav-link {
    transition: var(--transition-smooth);
    border-radius: 8px;
    margin: 4px 8px;
    position: relative;
    overflow: hidden;
}

.side-nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--logo-light-green);
    transform: scaleY(0);
    transition: var(--transition-smooth);
}

.side-nav-link:hover {
    background-color: rgba(124, 179, 66, 0.15);
    transform: translateX(5px);
}

.side-nav-link:hover::before {
    transform: scaleY(1);
}

.side-nav-link.active {
    background-color: rgba(124, 179, 66, 0.2);
    color: var(--logo-light-green) !important;
}

.side-nav-link.active .menu-text {
    color: var(--logo-light-green) !important;
    font-weight: 600;
}

.side-nav-link.active .menu-icon {
    color: var(--logo-light-green) !important;
}

.side-nav-link.active::before {
    transform: scaleY(1);
}

/* Sidebar Icons */
.side-nav-link .menu-icon {
    transition: var(--transition-bounce);
}

.side-nav-link:hover .menu-icon {
    transform: scale(1.2) rotate(5deg);
    color: var(--logo-light-green);
}

/* ============================================
   Header Styling
   ============================================ */

.app-topbar,
.navbar-header {
    background: linear-gradient(135deg, var(--logo-dark-green) 0%, var(--primary-green-dark) 100%) !important;
    border-bottom: 3px solid var(--logo-light-green);
    box-shadow: 0 2px 10px rgba(45, 80, 22, 0.3);
    color: #ffffff !important;
}

.app-topbar .topbar-link,
.app-topbar .topbar-item,
.app-topbar a {
    color: #ffffff !important;
}

.app-topbar .dropdown-menu {
    background: white !important;
    border: 1px solid var(--primary-green-border) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    min-width: 200px;
    z-index: 1050;
}

.app-topbar .dropdown-header {
    padding: 0.75rem 1rem;
    background: rgba(124, 179, 66, 0.05);
    border-bottom: 1px solid rgba(124, 179, 66, 0.1);
}

.app-topbar .dropdown-item {
    padding: 0.75rem 1rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.app-topbar .dropdown-item:hover {
    background-color: rgba(124, 179, 66, 0.1) !important;
    color: var(--logo-dark-green) !important;
}

.app-topbar .dropdown-item.text-danger:hover {
    background-color: rgba(220, 53, 69, 0.1) !important;
    color: #dc3545 !important;
}

.app-topbar .dropdown-divider {
    margin: 0.5rem 0;
    border-top: 1px solid rgba(124, 179, 66, 0.2);
}

/* ============================================
   Cards & Components
   ============================================ */

.card {
    transition: var(--transition-smooth);
    border: 1px solid rgba(124, 179, 66, 0.2);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(124, 179, 66, 0.25);
    border-color: var(--logo-light-green);
}

.card-header {
    background: linear-gradient(135deg, rgba(124, 179, 66, 0.08) 0%, rgba(124, 179, 66, 0.15) 100%);
    border-bottom: 2px solid var(--logo-light-green);
}

/* ============================================
   Form Elements
   ============================================ */

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-green) !important;
    box-shadow: 0 0 0 0.2rem var(--primary-green-subtle) !important;
    outline: none;
}

.form-check-input:checked {
    background-color: var(--primary-green) !important;
    border-color: var(--primary-green) !important;
}

/* ============================================
   Tables
   ============================================ */

.table thead th {
    background-color: var(--primary-green-subtle);
    color: var(--primary-green-dark);
    font-weight: 600;
    border-bottom: 2px solid var(--primary-green);
}

.table tbody tr {
    transition: var(--transition-smooth);
}

.table tbody tr:hover {
    background-color: rgba(0, 255, 0, 0.05);
    transform: scale(1.01);
}

/* ============================================
   Alerts & Notifications
   ============================================ */

.alert-success {
    background-color: rgba(0, 255, 0, 0.1);
    border-color: var(--primary-green);
    color: var(--primary-green-dark);
}

.alert-info {
    background-color: rgba(0, 255, 0, 0.08);
    border-color: var(--primary-green-border);
}

/* ============================================
   Badges
   ============================================ */

.badge.bg-primary,
.badge.bg-success {
    background-color: var(--primary-green) !important;
    color: #000 !important;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 0, 0.8);
    }
}

/* ============================================
   Animations
   ============================================ */

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Slide In Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

/* Bounce Animation */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.bounce-animation {
    animation: bounce 1s ease-in-out infinite;
}

/* Glow Animation */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 0, 0.8), 0 0 30px rgba(0, 255, 0, 0.6);
    }
}

.glow-effect {
    animation: glow 2s ease-in-out infinite;
}

/* ============================================
   Page Content Animations
   ============================================ */

.page-content {
    animation: fadeIn 0.8s ease-out;
}

/* ============================================
   Button Animations
   ============================================ */

.btn {
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* ============================================
   Icon Enhancements
   ============================================ */

[class^="ri-"],
[class*=" ri-"] {
    transition: var(--transition-smooth);
}

.side-nav-link:hover [class^="ri-"],
.side-nav-link:hover [class*=" ri-"] {
    color: var(--primary-green);
    transform: scale(1.15);
}

/* ============================================
   Loading Spinner (Green)
   ============================================ */

.spinner-border-primary {
    border-color: var(--primary-green);
    border-right-color: transparent;
}

/* ============================================
   Progress Bars
   ============================================ */

.progress-bar.bg-primary {
    background-color: var(--primary-green) !important;
    animation: progress-glow 2s ease-in-out infinite;
}

@keyframes progress-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 0, 0.8);
    }
}

/* ============================================
   Dropdown Menus
   ============================================ */

.dropdown-menu {
    border: 1px solid var(--primary-green-border);
    box-shadow: 0 4px 12px rgba(0, 255, 0, 0.1);
    animation: fadeIn 0.3s ease-out;
}

.dropdown-item:hover {
    background-color: var(--primary-green-subtle);
    color: var(--primary-green-dark);
}

/* ============================================
   Modal Styling
   ============================================ */

.modal-header {
    border-bottom: 2px solid var(--primary-green);
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.05) 0%, rgba(0, 255, 0, 0.1) 100%);
}

.modal-footer {
    border-top: 2px solid var(--primary-green-border);
}

/* ============================================
   Pagination
   ============================================ */

.page-link {
    transition: var(--transition-smooth);
    border-color: rgba(0, 255, 0, 0.2);
}

.page-link:hover {
    background-color: var(--primary-green-subtle);
    border-color: var(--primary-green);
    color: var(--primary-green-dark);
}

.page-item.active .page-link {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
    color: #000;
}

/* ============================================
   Scrollbar Styling
   ============================================ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-green);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-green-dark);
}

/* ============================================
   Utility Classes
   ============================================ */

.green-gradient {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-dark) 100%);
}

.green-shadow {
    box-shadow: 0 4px 12px rgba(0, 255, 0, 0.3);
}

.green-glow {
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.6);
}

/* ============================================
   Responsive Animations
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   Login Page Enhancements
   ============================================ */

.auth-bg {
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.05) 0%, rgba(0, 0, 0, 0.9) 100%);
    position: relative;
    overflow: hidden;
}

.auth-bg::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 255, 0, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
    top: -50%;
    left: -50%;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.auth-bg .card {
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    animation: fadeIn 0.8s ease-out;
}

/* ============================================
   Dashboard Cards Animation
   ============================================ */

.dashboard-card {
    animation: slideIn 0.6s ease-out;
    animation-fill-mode: both;
}

.dashboard-card:nth-child(1) { animation-delay: 0.1s; }
.dashboard-card:nth-child(2) { animation-delay: 0.2s; }
.dashboard-card:nth-child(3) { animation-delay: 0.3s; }
.dashboard-card:nth-child(4) { animation-delay: 0.4s; }

/* ============================================
   Hover Effects for Cards
   ============================================ */

.card-hover-effect {
    transition: var(--transition-smooth);
    cursor: pointer;
}

.card-hover-effect:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 255, 0, 0.2);
}

/* ============================================
   Input Field Animations
   ============================================ */

.form-control,
.form-select {
    transition: var(--transition-smooth);
}

.form-control:focus {
    transform: scale(1.02);
}

/* ============================================
   Table Row Animations
   ============================================ */

.table tbody tr {
    animation: fadeIn 0.5s ease-out;
    animation-fill-mode: both;
}

.table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.table tbody tr:nth-child(2) { animation-delay: 0.1s; }
.table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.table tbody tr:nth-child(4) { animation-delay: 0.2s; }
.table tbody tr:nth-child(5) { animation-delay: 0.25s; }

/* ============================================
   Badge Pulse Animation
   ============================================ */

.badge {
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ============================================
   Button Ripple Effect
   ============================================ */

.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* ============================================
   Loading States
   ============================================ */

.loading-spinner {
    border: 3px solid rgba(0, 255, 0, 0.1);
    border-top: 3px solid var(--primary-green);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   Success Message Animation
   ============================================ */

.alert-success {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   Button Groups - Gap Between Edit/Delete
   ============================================ */

.btn-group {
    gap: 8px !important;
    display: flex !important;
}

.btn-group .btn,
.btn-group form {
    margin: 0 !important;
}

.btn-group form {
    display: inline-block;
}

/* Edit and Delete buttons spacing */
.btn-group > .btn:not(:last-child),
.btn-group > form:not(:last-child) {
    margin-right: 8px !important;
}

/* Alternative: Use gap utility if available */
.d-grid.gap-2 .btn-group {
    gap: 8px;
}

/* ============================================
   Badge Colors - All Green
   ============================================ */

.badge.bg-info,
.badge.bg-success,
.badge.bg-primary {
    background-color: var(--primary-green) !important;
    color: #000 !important;
}

.badge.bg-info-subtle,
.badge.bg-success-subtle,
.badge.bg-primary-subtle {
    background-color: var(--primary-green-subtle) !important;
    color: var(--primary-green-dark) !important;
}

.text-info,
.text-success {
    color: var(--primary-green) !important;
}

.bg-info,
.bg-success {
    background-color: var(--primary-green) !important;
}

.bg-info-subtle,
.bg-success-subtle {
    background-color: var(--primary-green-subtle) !important;
}

/* ============================================
   Alert Colors
   ============================================ */

.alert-info {
    background-color: rgba(0, 255, 0, 0.1) !important;
    border-color: var(--primary-green-border) !important;
    color: var(--primary-green-dark) !important;
}

/* ============================================
   Sidebar - General Settings at Bottom
   ============================================ */

.side-nav {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.side-nav-item[style*="margin-top: auto"] {
    margin-top: auto !important;
    border-top: 1px solid rgba(124, 179, 66, 0.2);
    padding-top: 1rem;
}

/* ============================================
   Logo Background Transparent
   ============================================ */

.logo img,
.logo-lg img,
.logo-sm img,
.logo-light img,
.logo-dark img,
.auth-brand img {
    background: transparent !important;
    background-color: transparent !important;
    mix-blend-mode: normal;
}

.logo,
.logo-lg,
.logo-sm,
.logo-light,
.logo-dark,
.auth-brand {
    background: transparent !important;
    background-color: transparent !important;
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .btn,
    .sidebar,
    .navbar-header {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

