:root {
    --primary-color: #0d9488; /* Teal */
    --primary-hover: #0f766e;
    --secondary-color: #0ea5e9; /* Cyan */
    --secondary-hover: #0284c7;
    --dark-teal: #115e59;
    --bg-light: #f8fafc;
    --card-border-radius: 14px;
    --shadow-soft: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --transition-base: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background-color: var(--bg-light);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    color: #1e293b; /* Darker slate for high contrast */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

input, select, textarea, button {
    font-family: inherit !important;
}

/* Premium Header and Nav */
.bg-dark-teal {
    background-color: var(--dark-teal) !important;
    box-shadow: 0 2px 10px rgba(17, 94, 89, 0.15);
}

.brand-logo-text {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, #99f6e4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-teal-light {
    color: #99f6e4 !important;
}

/* Card Styling */
.card {
    border: none;
    border-radius: var(--card-border-radius);
    box-shadow: var(--shadow-soft);
    transition: var(--transition-base);
}

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

.card-header-premium {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-top-left-radius: var(--card-border-radius) !important;
    border-top-right-radius: var(--card-border-radius) !important;
    padding: 20px;
    border: none;
}

/* Rounded Profile Avatar */
.avatar-circle {
    width: 60px;
    height: 60px;
    background-color: #ccfbf1;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 700;
}

.avatar-circle-sm {
    width: 40px;
    height: 40px;
    background-color: #ccfbf1;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.1rem;
    font-weight: 700;
    transition: all 0.3s ease;
}

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

/* Buttons Styling */
.btn-primary-premium {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    padding: 10px 20px;
    transition: var(--transition-base);
}

.btn-primary-premium:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    color: white;
}

.btn-secondary-premium {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-weight: 600;
    padding: 10px 20px;
    transition: var(--transition-base);
}

.btn-secondary-premium:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Sidebar navigation */
.sidebar-nav .nav-link {
    color: #475569;
    font-weight: 500;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    transition: var(--transition-base);
}

.sidebar-nav .nav-link i {
    width: 20px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.sidebar-nav .nav-link:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

.sidebar-nav .nav-link.active {
    background-color: #ccfbf1;
    color: var(--primary-color);
    font-weight: 600;
}

/* Forms Styling */
.form-control, .form-select {
    border-radius: 8px;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    transition: var(--transition-base);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

/* Rating Systems (Star & Emoji) */
.star-rating-wrapper, .emoji-rating-wrapper {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
}

.star-rating-wrapper input, .emoji-rating-wrapper input {
    display: none;
}

.star-rating-wrapper label {
    font-size: 2.5rem;
    color: #cbd5e1;
    cursor: pointer;
    transition: var(--transition-base);
}

.star-rating-wrapper label:hover,
.star-rating-wrapper label:hover ~ label,
.star-rating-wrapper input:checked ~ label {
    color: #eab308; /* Gold Star */
}

.emoji-rating-wrapper label {
    font-size: 2.8rem;
    cursor: pointer;
    filter: grayscale(100%);
    transition: var(--transition-base);
}

.emoji-rating-wrapper label:hover,
.emoji-rating-wrapper label:hover ~ label,
.emoji-rating-wrapper input:checked ~ label {
    filter: grayscale(0%);
    transform: scale(1.15);
}

/* Multilingual Lang Badge */
.lang-switcher-btn {
    border-radius: 20px;
    padding: 4px 14px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Custom form builder drag items */
.form-builder-item {
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    padding: 15px;
    background-color: #ffffff;
    margin-bottom: 12px;
    position: relative;
    cursor: grab;
    transition: var(--transition-base);
}

.form-builder-item:hover {
    border-color: var(--primary-color);
    background-color: #f0fdfa;
}

.form-builder-item .actions {
    position: absolute;
    right: 15px;
    top: 15px;
}

/* Printable QR poster rules */
@media print {
    body {
        background-color: white;
        color: black;
    }
    .no-print {
        display: none !important;
    }
    .poster-container {
        box-shadow: none !important;
        border: 2px solid #333 !important;
        width: 100% !important;
        max-width: 600px !important;
        margin: 0 auto !important;
        page-break-inside: avoid;
    }
}

/* Poster Preview Design */
.poster-container {
    background-color: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-soft);
    max-width: 550px;
    margin: 20px auto;
    overflow: hidden;
    text-align: center;
}

.poster-header {
    background: linear-gradient(135deg, var(--dark-teal), var(--primary-color));
    color: white;
    padding: 30px 20px;
}

.poster-body {
    padding: 40px 30px;
}

.poster-qr-frame {
    display: inline-block;
    padding: 15px;
    background-color: #f8fafc;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    margin-bottom: 25px;
}

.poster-footer {
    background-color: #f1f5f9;
    padding: 20px;
    font-size: 0.9rem;
    color: #475569;
    border-top: 1px solid #e2e8f0;
}

/* Dynamic Collapsible Sidebar and Layout Columns */
.sidebar-col {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Set explicit default flex values for smooth transition in Bootstrap grids */
    flex: 0 0 25%;
    max-width: 25%;
    width: 25%;
}

@media (max-width: 991.98px) {
    .sidebar-col {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
        width: 33.333333%;
    }
}
@media (max-width: 767.98px) {
    .sidebar-col {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
    }
}

.main-content-col {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Set explicit default flex values for smooth transition in Bootstrap grids */
    flex: 0 0 75%;
    max-width: 75%;
    width: 75%;
}

@media (max-width: 991.98px) {
    .main-content-col {
        flex: 0 0 66.666667%;
        max-width: 66.666667%;
        width: 66.666667%;
    }
}
@media (max-width: 767.98px) {
    .main-content-col {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
    }
}

.sidebar-wrapper {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-profile-text {
    transition: opacity 0.2s ease, max-width 0.2s ease;
    opacity: 1;
    max-width: 200px;
    overflow: hidden;
}

.sidebar-nav .nav-link span {
    transition: opacity 0.2s ease, max-width 0.2s ease;
    opacity: 1;
    max-width: 200px;
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
}

/* Collapsed Sidebar State styling rules */
body.sidebar-collapsed .sidebar-col {
    width: 85px !important;
    flex: 0 0 85px !important;
    max-width: 85px !important;
}

body.sidebar-collapsed .main-content-col {
    width: calc(100% - 85px) !important;
    flex: 0 0 calc(100% - 85px) !important;
    max-width: calc(100% - 85px) !important;
}

body.sidebar-collapsed .sidebar-wrapper {
    padding-left: 8px !important;
    padding-right: 8px !important;
}

body.sidebar-collapsed .sidebar-profile-text,
body.sidebar-collapsed .sidebar-nav .nav-link span {
    opacity: 0 !important;
    max-width: 0 !important;
    pointer-events: none;
}

body.sidebar-collapsed .sidebar-profile-block {
    justify-content: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body.sidebar-collapsed .sidebar-profile-block .avatar-circle-sm {
    margin-right: 0 !important;
}

body.sidebar-collapsed .sidebar-nav .nav-link {
    justify-content: center;
    padding: 10px 0;
}

body.sidebar-collapsed .sidebar-nav .nav-link i {
    margin-right: 0 !important;
    font-size: 1.25rem;
}

/* Premium hover effect for cards */
.card-premium-hover {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out !important;
}
.card-premium-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08) !important;
}

/* Teal Utility Colors */
.bg-teal-light {
    background-color: #ccfbf1 !important; /* Light teal tint */
}
.bg-teal-light-subtle {
    background-color: #f0fdfa !important; /* Extremely light teal tint */
}
.text-dark-teal {
    color: var(--dark-teal) !important;
}
.border-teal-light {
    border-color: #99f6e4 !important; /* Soft teal border */
}

/* Opacity utilities missing in standard Bootstrap */
.opacity-10 {
    opacity: 0.1 !important;
}

/* Custom Premium Checkbox and Radio Buttons styling */
.form-check {
    padding-left: 1.85em;
    margin-bottom: 0.65rem;
}
.form-check-input {
    width: 1.25em;
    height: 1.25em;
    margin-top: 0.15em;
    margin-left: -1.85em;
    background-color: #ffffff;
    border: 2px solid #cbd5e1 !important; /* Premium high-contrast slate border */
    cursor: pointer;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.form-check-input:checked {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}
.form-check-input:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.25) !important;
}
.form-check-label {
    cursor: pointer;
    font-weight: 500;
    color: #334155;
    padding-left: 0.25rem;
    user-select: none;
}

/* ==========================================================================
   Animations & Micro-Interactions
   ========================================================================== */

/* Fade In Up (Cards, Modals) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.animate-fade-in-up {
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Subtle Pulse (Buttons, Badges) */
@keyframes softPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
.animate-pulse-hover:hover {
    animation: softPulse 1.5s infinite;
}

/* Slide In Right (Alerts, Toasts) */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
.animate-slide-in-right {
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Apply staggered animations globally */
.card, .alert, .sidebar-wrapper {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.row > div:nth-child(1) .card { animation-delay: 0.1s; }
.row > div:nth-child(2) .card { animation-delay: 0.2s; }
.row > div:nth-child(3) .card { animation-delay: 0.3s; }
.row > div:nth-child(4) .card { animation-delay: 0.4s; }

/* Dropdown Menu Slide Down */
.dropdown-menu {
    animation: fadeInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    transform-origin: top;
}

/* Enhanced Button Hover States */
.btn-primary-premium, .btn-secondary-premium {
    position: relative;
    overflow: hidden;
}
.btn-primary-premium::after, .btn-secondary-premium::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.4s ease, height 0.4s ease, opacity 0.4s ease;
    opacity: 0;
}
.btn-primary-premium:active::after, .btn-secondary-premium:active::after {
    width: 300%;
    height: 300%;
    opacity: 1;
    transition: 0s;
}
