/**
 * Custom CSS
 * Ankete Platforma - PULS mladih
 * 
 * Autor: Mensch (https://mensch.rs)
 * Klijent: PULS mladih (https://koms.rs)
 */

/* ===================================================
   ADMIN D-FLEX LAYOUT FIX - REMOVED
   =================================================== */

/* CSS fix removed - was affecting all admin pages incorrectly */

/* ===================================================
   LEADERBOARD PODIUM STYLES
   =================================================== */

.podium-container {
    padding: 2rem 0;
}

.podium-wrapper {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 2rem;
    position: relative;
    min-height: 300px;
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.podium-user {
    text-align: center;
    margin-bottom: 1rem;
    z-index: 2;
    position: relative;
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-size: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.user-avatar.champion {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
    font-size: 2.5rem;
    box-shadow: 0 6px 20px rgba(255,215,0,0.4);
}

.podium-base {
    width: 120px;
    background: linear-gradient(135deg, #e0e0e0 0%, #bdbdbd 100%);
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.podium-base-1 {
    height: 120px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
}

.podium-base-2 {
    height: 90px;
    background: linear-gradient(135deg, #c0c0c0 0%, #a8a8a8 100%);
}

.podium-base-3 {
    height: 70px;
    background: linear-gradient(135deg, #cd7f32 0%, #b8860b 100%);
}

.trophy-icon {
    margin-top: 0.5rem;
    font-size: 2rem;
}

.text-silver {
    color: #c0c0c0 !important;
}

.text-bronze {
    color: #cd7f32 !important;
}

.remaining-users {
    margin-top: 3rem;
}

.leaderboard-card {
    border: none;
    border-bottom: 1px solid #f0f0f0;
    padding: 1rem;
    transition: background-color 0.2s;
}

.leaderboard-card:hover {
    background-color: #f8f9fa;
}

.rank-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    background: #6c757d;
    color: white;
}

/* ===================================================
   APP-LIKE ADMIN SIDEBAR STYLES
   =================================================== */

/* Desktop App Sidebar */
.app-sidebar {
    width: 280px;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
}

.app-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-logo {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.app-title h6 {
    color: white;
    margin: 0;
    font-weight: 600;
}

.app-title small {
    color: rgba(255,255,255,0.7);
}

.app-sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.app-sidebar-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.app-sidebar-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    transform: translateX(4px);
}

.app-sidebar-item.active {
    background: rgba(255,255,255,0.2);
    color: white;
    font-weight: 500;
}

.app-sidebar-item .material-symbols-rounded {
    margin-right: 0.75rem;
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.app-sidebar-label {
    font-size: 14px;
    font-weight: 500;
}

/* Facebook-style Dropdown */
.app-sidebar-dropdown {
    width: 320px;
    border: none;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    padding: 0;
    margin-left: 1rem;
}

.app-dropdown-grid {
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.app-dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.2s;
}

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

.app-dropdown-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.app-dropdown-content {
    flex: 1;
}

.app-dropdown-title {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 2px;
}

.app-dropdown-desc {
    font-size: 12px;
    color: #666;
}

.dropdown-footer {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0 0 16px 16px;
}

/* User Profile */
.app-sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.app-user-profile {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    color: white;
    text-decoration: none;
}

.app-user-profile:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.app-user-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
}

.app-user-info {
    flex: 1;
}

.app-user-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

.app-user-role {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}

.app-user-arrow {
    font-size: 16px;
    opacity: 0.7;
}

/* Mobile Bottom Navigation */
.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e9ecef;
    z-index: 1000;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.1);
}

.app-nav-container {
    display: flex;
    padding: 0.5rem 0;
}

.app-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    text-decoration: none;
    color: #6c757d;
    transition: color 0.2s;
    cursor: pointer;
}

.app-nav-item:hover,
.app-nav-item.active {
    color: #667eea;
}

.app-nav-item .material-symbols-rounded {
    font-size: 24px;
    margin-bottom: 0.25rem;
}

.app-nav-label {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
}

.app-dropdown {
    width: 280px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border: none;
}

/* Content adjustment for app sidebar */
.app-main-content {
    margin-left: 280px;
    min-height: 100vh;
    background: #f8f9fa;
}

@media (max-width: 767.98px) {
    .app-main-content {
        margin-left: 0;
        padding-bottom: 80px; /* Space for bottom nav */
    }
}

/* ===================================================
   GLOBALNI STILOVI
   =================================================== */

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-gradient: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    --warning-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --info-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --danger-gradient: linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%);
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.15);
    
    --border-radius: 15px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
}

/* ===================================================
   UTILITY KLASE
   =================================================== */

.bg-primary-gradient {
    background: var(--primary-gradient) !important;
}

.bg-success-gradient {
    background: var(--success-gradient) !important;
}

.bg-warning-gradient {
    background: var(--warning-gradient) !important;
}

.bg-info-gradient {
    background: var(--info-gradient) !important;
}

.bg-danger-gradient {
    background: var(--danger-gradient) !important;
}

.shadow-custom {
    box-shadow: var(--shadow-md);
}

.shadow-hover {
    transition: var(--transition);
}

.shadow-hover:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.rounded-custom {
    border-radius: var(--border-radius) !important;
}

.transition-all {
    transition: var(--transition);
}

/* ===================================================
   KOMPONENTE
   =================================================== */

/* Buttons */
.btn {
    border-radius: 10px;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1.5rem;
}

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

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    color: white;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-hover {
    transition: var(--transition);
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Forms */
.form-control,
.form-select {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-floating > .form-control,
.form-floating > .form-select {
    height: auto;
    padding: 1rem 0.75rem;
}

/* ===================================================
   NAVIGACIJA
   =================================================== */

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar {
    box-shadow: var(--shadow-sm);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 0.5rem 0;
}

.bottom-nav .nav-item {
    display: block;
    text-align: center;
    color: #6c757d;
    text-decoration: none;
    transition: var(--transition);
    padding: 0.5rem;
}

.bottom-nav .nav-item.active,
.bottom-nav .nav-item:hover {
    color: #667eea;
}

.bottom-nav .nav-item .material-symbols-rounded {
    font-size: 24px;
    display: block;
}

.bottom-nav .nav-item small {
    font-size: 0.7rem;
    display: block;
    margin-top: 0.2rem;
}

/* ===================================================
   STATISTIKE KARTICE
   =================================================== */

.stats-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: none;
    transition: var(--transition);
    text-align: center;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stats-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
}

/* ===================================================
   ANKETE
   =================================================== */

.survey-card {
    background: white;
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.survey-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.survey-header {
    background: var(--primary-gradient);
    color: white;
    padding: 1.5rem;
}

/* ===================================================
   BADGES
   =================================================== */

.badge-item {
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.badge-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.badge-icon {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    border-radius: 50%;
    margin: 0 auto 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    aspect-ratio: 1;
    box-sizing: border-box;
}

/* ===================================================
   FORM BUILDER
   =================================================== */

.form-builder-sidebar {
    background: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 1rem;
    height: 100%;
}

.form-builder-canvas {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    min-height: 600px;
    border: 2px dashed #e9ecef;
}

.form-builder-canvas.has-items {
    border: 2px solid #e9ecef;
}

.form-element {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    position: relative;
    transition: var(--transition);
}

.form-element:hover {
    border-color: #667eea;
    box-shadow: var(--shadow-sm);
}

.form-element-toolbar {
    position: absolute;
    top: -12px;
    right: 10px;
    background: white;
    border-radius: 20px;
    padding: 0.25rem 0.5rem;
    box-shadow: var(--shadow-sm);
    display: none;
}

.form-element:hover .form-element-toolbar {
    display: flex;
}

.draggable-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    cursor: grab;
    transition: var(--transition);
}

.draggable-item:hover {
    border-color: #667eea;
    transform: translateX(5px);
}

.draggable-item:active {
    cursor: grabbing;
}

/* ===================================================
   ADMIN PANEL
   =================================================== */

.admin-sidebar {
    background: white;
    box-shadow: var(--shadow-sm);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    z-index: 1000;
    transition: width 0.3s ease, var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.admin-content,
.main-content {
    margin-left: 250px !important;
    padding: 1rem 2rem;
    background: #f8f9fa;
    min-height: 100vh;
    width: calc(100% - 250px);
    box-sizing: border-box;
    transition: margin-left 0.3s ease, width 0.3s ease;
}

.content-wrapper {
    padding: 0;
    width: 100%;
}

/* Tabele da zauzmu punu širinu */
.table-responsive {
    width: 100%;
}

.card {
    width: 100%;
}

/* Admin stranice da koriste punu širinu */
.main-content .row,
.admin-content .row {
    margin: 0 -0.5rem;
}

.main-content .col-md-3,
.main-content .col-md-6,
.main-content .col-md-12,
.admin-content .col-md-3,
.admin-content .col-md-6,
.admin-content .col-md-12 {
    padding: 0 0.5rem;
}

.admin-nav-item {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #6c757d;
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.admin-nav-item:hover,
.admin-nav-item.active {
    background: #f8f9fa;
    color: #667eea;
    border-left-color: #667eea;
}

/* ===================================================
   SIDEBAR COLLAPSE FUNCTIONALITY
   =================================================== */

/* Collapsed sidebar styles */
.admin-sidebar.collapsed {
    width: 80px;
    transition: width 0.3s ease;
}

.admin-sidebar.collapsed .admin-nav-item {
    padding: 0.75rem 0;
    text-align: center;
    border-left: none;
    border-bottom: 3px solid transparent;
    position: relative;
    display: flex !important;
    justify-content: center;
    align-items: center;
}

.admin-sidebar.collapsed .admin-nav-item:hover,
.admin-sidebar.collapsed .admin-nav-item.active {
    border-left: none;
    border-bottom-color: #667eea;
}

/* Hide text in collapsed mode */
.admin-sidebar.collapsed .admin-nav-item span:not(.material-symbols-rounded),
.admin-sidebar.collapsed .admin-nav-item:not([class*="material-symbols-rounded"]) span:not(.material-symbols-rounded),
.admin-sidebar.collapsed .nav-header,
.admin-sidebar.collapsed .p-3 div,
.admin-sidebar.collapsed .p-3 small {
    display: none !important;
}

/* Center icons in collapsed mode */
.admin-sidebar.collapsed .material-symbols-rounded {
    margin: 0 !important;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    width: 100%;
    height: auto;
}

/* Force hide all text nodes in nav items when collapsed */
.admin-sidebar.collapsed .admin-nav-item {
    font-size: 0 !important;
    white-space: nowrap;
    overflow: hidden;
}

.admin-sidebar.collapsed .admin-nav-item .material-symbols-rounded {
    font-size: 24px !important;
}

/* Hide all text content in nav items */
.admin-sidebar.collapsed .admin-nav-item * {
    font-size: 0 !important;
}

.admin-sidebar.collapsed .admin-nav-item .material-symbols-rounded {
    font-size: 24px !important;
}

/* Hide logo text but keep image */
.admin-sidebar.collapsed .p-3 {
    padding: 1rem 0.5rem !important;
    text-align: center;
}

.admin-sidebar.collapsed .p-3 img {
    height: 32px;
    margin-bottom: 0;
}

/* Collapsed header styling */
.admin-sidebar.collapsed .p-3 {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.admin-sidebar.collapsed .p-3 img {
    height: 24px !important;
    margin-bottom: 0.5rem !important;
}

.admin-sidebar.collapsed #sidebarToggle {
    margin: 0.5rem 0 0 0;
}

/* Modern toggle button styling */
#sidebarToggle {
    transition: all 0.3s ease;
    border-radius: 8px !important;
}

#sidebarToggle:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.admin-sidebar.collapsed #sidebarToggle {
    border-radius: 50% !important;
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Tooltip for collapsed items */
.admin-sidebar.collapsed .admin-nav-item {
    position: relative;
}

.admin-sidebar.collapsed .admin-nav-item::after {
    content: attr(data-title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #333;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
    margin-left: 10px;
    font-size: 0.875rem;
}

.admin-sidebar.collapsed .admin-nav-item::before {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
    margin-left: 4px;
}

.admin-sidebar.collapsed .admin-nav-item:hover::after,
.admin-sidebar.collapsed .admin-nav-item:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Adjust main content when sidebar is collapsed */
.admin-content.sidebar-collapsed,
.main-content.sidebar-collapsed {
    margin-left: 80px !important;
    width: calc(100% - 80px) !important;
    transition: all 0.3s ease;
}

/* ===================================================
   RESPONSIVE
   =================================================== */

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-sidebar.show {
        transform: translateX(0);
    }
    
    /* On mobile, override collapsed styles */
    .admin-sidebar.collapsed {
        width: 250px !important;
    }
    
    .admin-content,
    .main-content {
        margin-left: 0 !important;
        padding: 1rem !important;
        width: 100% !important;
    }
    
    .admin-content.sidebar-collapsed,
    .main-content.sidebar-collapsed {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .stats-card {
        padding: 1rem;
    }
    
    .stats-icon {
        width: 50px;
        height: 50px;
    }
    
    .bottom-nav {
        display: block;
    }
    
    .main-content {
        padding-bottom: 80px;
    }
}

@media (min-width: 769px) {
    .bottom-nav {
        display: none;
    }
    
    .main-content {
        padding-bottom: 2rem;
    }
}

/* ===================================================
   ANIMACIJE
   =================================================== */

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

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

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

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

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

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

/* ===================================================
   UTILITIES
   =================================================== */

.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: bold;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===================================================
   DARK MODE SUPPORT
   =================================================== */

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .stats-card,
[data-bs-theme="dark"] .survey-card,
[data-bs-theme="dark"] .badge-item {
    background: #2d3748;
    color: #e2e8f0;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

[data-bs-theme="dark"] .bottom-nav {
    background: #2d3748;
}

/* ===================================================
   PRINT STYLES
   =================================================== */

@media print {
    .navbar,
    .bottom-nav,
    .btn,
    .form-element-toolbar {
        display: none !important;
    }
    
    .card,
    .stats-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .admin-content {
        margin-left: 0 !important;
    }
}

/* ===================================================
   MOBILE BOTTOM NAVIGATION
   =================================================== */

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e9ecef;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem 0;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #6c757d;
    transition: var(--transition);
    padding: 0.5rem;
    border-radius: 8px;
    min-width: 60px;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.mobile-nav-item .material-symbols-rounded {
    font-size: 20px;
    margin-bottom: 0.25rem;
}

.mobile-nav-item small {
    font-size: 0.7rem;
    text-align: center;
}

/* Add bottom padding to content when mobile nav is visible */
@media (max-width: 768px) {
    body {
        padding-bottom: 80px;
    }
    
    .admin-content,
    .main-content {
        padding-bottom: 100px;
    }
}

/* Ensure proper positioning for both desktop and mobile */
@media (min-width: 769px) {
    body .admin-content,
    body .main-content {
        margin-left: 250px !important;
    }
}

/* ===================================================
   CONDITIONAL LOGIC STYLES
   =================================================== */

/* Conditional logic indicator */
.form-element.has-conditional-logic {
    border-left: 4px solid #0dcaf0;
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.05) 0%, rgba(13, 202, 240, 0.02) 100%);
}

.form-element.has-conditional-logic .element-header {
    position: relative;
}

.form-element.has-conditional-logic .element-header::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    width: 16px;
    height: 16px;
    background: #0dcaf0;
    border-radius: 50%;
    opacity: 0.2;
}

/* Conditional logic builder */
.conditional-logic-builder {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.condition-row {
    background: white;
    border: 1px solid #dee2e6 !important;
    transition: all 0.2s ease;
}

.condition-row:hover {
    border-color: #0dcaf0 !important;
    box-shadow: 0 2px 8px rgba(13, 202, 240, 0.1);
}

.condition-row .form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.condition-row .form-select,
.condition-row .form-control {
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.875rem;
}

.condition-row .form-select:focus,
.condition-row .form-control:focus {
    border-color: #0dcaf0;
    box-shadow: 0 0 0 0.2rem rgba(13, 202, 240, 0.25);
}

/* Logic operators styling */
.condition-row .form-select option {
    font-size: 0.875rem;
    padding: 8px;
}

/* AND checkbox styling */
.condition-row .form-check {
    margin-top: 1.5rem;
}

.condition-row .form-check-input:checked {
    background-color: #0dcaf0;
    border-color: #0dcaf0;
}

.condition-row .form-check-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Conditional action section */
.conditional-logic-builder .form-check {
    margin-bottom: 0.75rem;
}

.conditional-logic-builder .form-check-input:checked {
    background-color: #198754;
    border-color: #198754;
}

/* Skip to question section */
#skipToSection {
    background: #e8f5e8;
    border-radius: 6px;
    padding: 15px;
    border: 1px solid #c3e6c3;
}

#skipToSection .form-select {
    border-color: #28a745;
}

#skipToSection .form-select:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Conditional logic buttons */
.conditional-logic-builder .btn-outline-primary {
    border-color: #0dcaf0;
    color: #0dcaf0;
}

.conditional-logic-builder .btn-outline-primary:hover {
    background-color: #0dcaf0;
    border-color: #0dcaf0;
    color: white;
}

.conditional-logic-builder .btn-outline-success {
    border-color: #198754;
    color: #198754;
}

.conditional-logic-builder .btn-outline-success:hover {
    background-color: #198754;
    border-color: #198754;
    color: white;
}

/* Empty state styling */
.conditional-logic-builder .text-center.text-muted {
    background: white;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 30px 20px;
}

.conditional-logic-builder .text-center.text-muted .material-symbols-rounded {
    color: #6c757d;
    opacity: 0.6;
}

/* Conditional logic header */
.conditional-logic-builder h6 {
    color: #495057;
    font-weight: 700;
}

.conditional-logic-builder h6 .material-symbols-rounded {
    color: #0dcaf0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .condition-row .row {
        margin: 0;
    }
    
    .condition-row .col-md-4,
    .condition-row .col-md-3,
    .condition-row .col-md-1 {
        margin-bottom: 1rem;
    }
    
    .condition-row .col-md-1 {
        text-align: center;
    }
    
    .conditional-logic-builder {
        padding: 15px;
    }
}

/* Animation for conditional logic toggle */
.conditional-logic-builder {
    transition: all 0.3s ease;
}

.conditional-logic-builder.d-none {
    opacity: 0;
    transform: translateY(-10px);
}

/* Enhanced visual feedback */
.form-element.has-conditional-logic .element-toolbar .badge {
    animation: pulse 2s infinite;
}

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

/* Logic flow visualization */
.conditional-logic-flow {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    border: 1px solid #e9ecef;
}

.conditional-logic-flow .flow-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.conditional-logic-flow .flow-item:last-child {
    margin-bottom: 0;
}

.conditional-logic-flow .flow-arrow {
    margin: 0 10px;
    color: #6c757d;
    font-size: 18px;
}

.conditional-logic-flow .flow-condition {
    flex: 1;
    font-size: 0.875rem;
    color: #495057;
}

.conditional-logic-flow .flow-action {
    font-weight: 600;
    color: #0dcaf0;
}

/* ===================================================
   ENHANCED VISUAL FEEDBACK & ANIMATIONS
   =================================================== */

/* Element item interactions */
.element-item {
    transition: all 0.2s ease;
    cursor: grab;
}

.element-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.element-item:active {
    cursor: grabbing;
    transform: scale(0.98);
}

.element-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

/* Canvas drag and drop feedback */
.builder-canvas.drag-over {
    border: 2px dashed #0dcaf0 !important;
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.05) 0%, rgba(13, 202, 240, 0.02) 100%);
    transform: scale(1.01);
}

.builder-canvas.drag-over .empty-state {
    opacity: 0.3;
}

/* Form element animations */
.form-element {
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.form-element:hover {
    border-color: #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-element.has-conditional-logic {
    animation: slideInLeft 0.5s ease;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Conditional logic badge animations */
.form-element.has-conditional-logic .badge {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-1px);
    }
}

/* Enhanced modal animations */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: scale(0.8);
}

.modal.show .modal-dialog {
    transform: scale(1);
}

/* Conditional logic section animations */
.conditional-logic-builder {
    animation: fadeInUp 0.4s ease;
}

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

/* Condition row animations */
.condition-row {
    animation: slideInRight 0.3s ease;
}

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

/* Visual flow animations */
.conditional-logic-flow .flow-item {
    animation: fadeIn 0.5s ease;
    animation-fill-mode: both;
}

.conditional-logic-flow .flow-item:nth-child(1) { animation-delay: 0.1s; }
.conditional-logic-flow .flow-item:nth-child(2) { animation-delay: 0.2s; }
.conditional-logic-flow .flow-item:nth-child(3) { animation-delay: 0.3s; }
.conditional-logic-flow .flow-item:nth-child(4) { animation-delay: 0.4s; }
.conditional-logic-flow .flow-item:nth-child(5) { animation-delay: 0.5s; }

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

/* Enhanced button interactions */
.btn {
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

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

/* Form validation feedback */
.form-control.is-invalid,
.form-select.is-invalid {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Success feedback */
.form-control.is-valid {
    animation: successPulse 0.5s ease;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0dcaf0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced tooltips */
.tooltip {
    font-size: 0.875rem;
}

.tooltip-inner {
    background-color: #495057;
    color: white;
    border-radius: 6px;
    padding: 8px 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsive enhancements */
@media (max-width: 768px) {
    .element-item:hover {
        transform: none;
    }
    
    .form-element:hover {
        box-shadow: none;
    }
    
    .btn:hover {
        transform: none;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-element.has-conditional-logic {
        border-left-width: 6px;
    }
    
    .condition-row {
        border-width: 2px;
    }
    
    .conditional-logic-builder {
        border-width: 2px;
    }
}

/* ===================================================
   PAGE NAVIGATION & MANAGEMENT STYLES
   =================================================== */

/* Page navigation controls */
.page-navigation-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-navigation-controls .btn {
    padding: 0.375rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.page-navigation-controls .btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.page-navigation-controls .btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Page selector */
#pageSelector {
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.875rem;
    padding: 0.375rem 0.5rem;
    background-color: white;
    transition: border-color 0.2s ease;
}

#pageSelector:focus {
    border-color: #0dcaf0;
    box-shadow: 0 0 0 0.2rem rgba(13, 202, 240, 0.25);
}

/* Page info badge */
#pageInfo {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
}

/* Page header in canvas */
.page-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.page-header h6 {
    color: #495057;
    font-weight: 700;
    margin: 0;
}

.page-header .material-symbols-rounded {
    color: #6c757d;
}

.page-stats {
    font-size: 0.875rem;
}

/* Page message container */
#pageMessageContainer {
    background: transparent;
    min-height: 20px;
}

#pageMessageContainer .alert {
    margin-bottom: 0;
    border-radius: 6px;
    font-size: 0.875rem;
}

#pageMessageContainer .alert-success {
    background-color: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

#pageMessageContainer .alert-info {
    background-color: #cff4fc;
    border-color: #b6effb;
    color: #055160;
}

#pageMessageContainer .alert-warning {
    background-color: #fff3cd;
    border-color: #ffecb5;
    color: #664d03;
}

#pageMessageContainer .alert-danger {
    background-color: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}

/* Enhanced page management */
.page-management-tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.page-management-tools .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Page navigation animations */
.page-transition {
    animation: pageSlide 0.3s ease;
}

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

/* Responsive page navigation */
@media (max-width: 768px) {
    .page-navigation-controls {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    #pageSelector {
        min-width: 100px;
        font-size: 0.8rem;
    }
    
    .page-header {
        padding: 0.75rem;
    }
    
    .page-header h6 {
        font-size: 0.9rem;
    }
    
    .page-stats {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .card-header .d-flex {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .page-navigation-controls {
        justify-content: center;
    }
    
    #pageInfo {
        text-align: center;
    }
}

/* Page operation feedback */
.page-operation-feedback {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 300px;
}

.page-operation-feedback .toast {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Enhanced page visibility */
.page-visibility-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    width: 8px;
    height: 8px;
}

.page-visibility-indicator.active {
    background: #28a745;
}

.page-visibility-indicator.inactive {
    background: #6c757d;
}

/* ===================================================
   COOKIE CONSENT STYLES
   =================================================== */

.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 1.5rem;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.3);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}

.cookie-consent-banner.show {
    transform: translateY(0);
}

.cookie-consent-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    gap: 2rem;
}

.cookie-consent-text {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.cookie-icon {
    font-size: 2.5rem;
    color: #f39c12;
    flex-shrink: 0;
}

.cookie-message h5 {
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.cookie-message p {
    margin: 0;
    opacity: 0.9;
    line-height: 1.4;
}

.cookie-consent-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.cookie-consent-actions .btn {
    white-space: nowrap;
    font-size: 0.875rem;
}

/* Cookie Settings Modal */
.cookie-category {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    background: #f8f9fa;
}

.cookie-details {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #dee2e6;
}

.cookie-success-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    color: #333;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.cookie-success-toast.show {
    transform: translateX(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .cookie-consent-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .cookie-consent-text {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-consent-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .cookie-consent-actions .btn {
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .cookie-consent-banner {
        padding: 1rem;
    }
    
    .cookie-consent-actions {
        flex-direction: column;
    }
    
    .cookie-consent-actions .btn {
        width: 100%;
    }
}