/* Cross-platform base styles */
* { 
    font-family: 'Vazirmatn', sans-serif;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* ========== CSS CUSTOM PROPERTIES (DESIGN TOKENS) ========== */
:root {
    /* Color Palette - Grays */
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;
    
    /* Color Palette - Indigo/Primary */
    --color-indigo-50: #eef2ff;
    --color-indigo-100: #e0e7ff;
    --color-indigo-500: #6366f1;
    --color-indigo-600: #4f46e5;
    --color-indigo-700: #4338ca;
    
    /* Color Palette - Purple */
    --color-purple-500: #9333ea;
    --color-purple-600: #8b5cf6;
    
    /* Color Palette - Other Colors */
    --color-white: #ffffff;
    --color-blue-50: #dbeafe;
    --color-blue-500: #2563eb;
    --color-green-50: #dcfce7;
    --color-green-500: #16a34a;
    --color-orange-50: #ffedd5;
    --color-orange-500: #ea580c;
    --color-pink-50: #fce7f3;
    --color-pink-500: #db2777;
    --color-yellow-50: #fef3c7;
    --color-yellow-500: #d97706;
    --color-red-50: #fee2e2;
    --color-red-500: #dc2626;
    
    /* Border Colors */
    --border-color-gray-100: #f3f4f6;
    --border-color-gray-200: #e5e7eb;
    --border-color-indigo-500: #6366f1;
    
    /* Border Widths */
    --border-width-1: 1px;
    --border-width-2: 2px;
    
    /* Gradients */
    --gradient-primary: linear-gradient(to bottom right, #6366f1, #9333ea);
    --gradient-logo: linear-gradient(to bottom right, #6366f1, #9333ea);
    --gradient-selected: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    --gradient-text: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    
    /* Z-Index Layers */
    --z-base: 0;
    --z-overlay: 999;
    --z-popover: 1000;
    --z-modal: 10000;
    --z-datepicker: 9999;
}

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

/* ========== UTILITY CLASSES ========== */

/* Background Colors - REMOVED (Use Tailwind) */

/* Gradient Backgrounds */
.bg-gradient-primary { background: var(--gradient-primary) !important; }
.bg-gradient-logo { background: var(--gradient-logo) !important; }
.bg-gradient-selected { background: var(--gradient-selected) !important; }

/* Border Utilities */
.border-gray-100 { border: var(--border-width-1) solid var(--border-color-gray-100) !important; }
.border-gray-200 { border: var(--border-width-1) solid var(--border-color-gray-200) !important; }
.border-gray-200-2 { border: var(--border-width-2) solid var(--border-color-gray-100) !important; }
.border-indigo-500 { border: var(--border-width-2) solid var(--border-color-indigo-500) !important; }
.border-b-gray-100 { border-bottom: var(--border-width-1) solid var(--border-color-gray-100) !important; }
.border-b-gray-200 { border-bottom: var(--border-width-1) solid var(--border-color-gray-200) !important; }
.border-l-gray-200 { border-left: var(--border-width-1) solid var(--border-color-gray-200) !important; }

/* Text Colors - REMOVED (Use Tailwind) */

/* Z-Index Utilities */
.z-popover { z-index: var(--z-popover) !important; }
.z-modal { z-index: var(--z-modal) !important; }
.z-datepicker { z-index: var(--z-datepicker) !important; }

/* ========== ICON CLASSES ========== */

/* Icon Backgrounds */
.icon-bg-orange { background: var(--color-orange-50) !important; }
.icon-bg-blue { background: var(--color-blue-50) !important; }
.icon-bg-green { background: var(--color-green-50) !important; }
.icon-bg-purple { background: var(--color-indigo-50) !important; }
.icon-bg-pink { background: var(--color-pink-50) !important; }
.icon-bg-yellow { background: var(--color-yellow-50) !important; }
.icon-bg-red { background: var(--color-red-50) !important; }

/* Icon Colors */
.icon-orange { color: var(--color-orange-500) !important; }
.icon-blue { color: var(--color-blue-500) !important; }
.icon-green { color: var(--color-green-500) !important; }
.icon-purple { color: var(--color-indigo-500) !important; }
.icon-pink { color: var(--color-pink-500) !important; }
.icon-yellow { color: var(--color-yellow-500) !important; }
.icon-red { color: var(--color-red-500) !important; }

/* ========== COMPONENT CLASSES ========== */

/* Step Card Base */
.step-card-base {
    background: var(--color-white);
    border: var(--border-width-2) solid var(--border-color-gray-100);
}

/* Button Secondary */
.button-secondary {
    border: var(--border-width-1) solid var(--border-color-gray-200);
    color: var(--color-gray-600);
    background: var(--color-white);
}

/* Card Container */
.card-container {
    background: var(--color-white);
    border: var(--border-width-1) solid var(--border-color-gray-100);
}

/* Sidebar Base */
.sidebar-base {
    background: var(--color-white);
    border-left: var(--border-width-1) solid var(--border-color-gray-200);
}

/* Header Base */
.header-base {
    background: var(--color-white);
    border-bottom: var(--border-width-1) solid var(--border-color-gray-200);
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c7c7c7; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }
.step-card { transition: all 0.3s ease; }
.step-card:hover { transform: translateY(-4px); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15); }
.step-card:focus { outline: 2px solid #6366f1; outline-offset: 2px; }
.step-card.selected { border-color: #6366f1 !important; background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%) !important; }
.step-card.selected:hover { transform: translateY(-2px); }
.step-card.selected:focus { outline: none; }
/* Wizard Transition Styles */
#wizard-content {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    position: relative;
    overflow: hidden;
}

.wizard-step {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%); /* Default: Next (Right) */
    transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out, visibility 0.5s;
    pointer-events: none;
}

.wizard-step.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
    z-index: 10;
}

.wizard-step.prev {
    transform: translateX(-100%); /* Prev (Left) */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.map-container { height: 280px; width: 100%; border-radius: 1rem; z-index: 0; }
.tag-btn { transition: all 0.2s ease; background: #f9fafb; min-height: 44px; }
.tag-btn:hover { background: #f3f4f6; border-color: #d1d5db; transform: translateY(-1px); }
.tag-btn:focus { outline: 2px solid #6366f1; outline-offset: 2px; }
.tag-btn.selected { background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%); color: #4338ca; border-color: #6366f1 !important; font-weight: 500; }
.tag-btn.selected:hover { transform: translateY(-1px); }
.day-btn { transition: all 0.2s ease; min-height: 44px; min-width: 44px; }
.day-btn:hover { transform: scale(1.05); }
.day-btn:focus { outline: 2px solid #6366f1; outline-offset: 2px; }
.day-btn.selected { background: #6366f1; color: white; }
.day-btn.selected:hover { background: #4f46e5; }
/* Range slider styling */
input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; width: 100%; min-height: 44px; }
input[type="range"]::-webkit-slider-runnable-track { background: #e5e7eb; height: 8px; border-radius: 4px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; margin-top: -4px; background-color: #6366f1; height: 20px; width: 20px; border-radius: 50%; transition: all 0.2s ease; }
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.1); background-color: #4f46e5; }
input[type="range"]:focus { outline: none; }
input[type="range"]:focus::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2); }
/* Firefox */
input[type="range"]::-moz-range-track { background: #e5e7eb; height: 8px; border-radius: 4px; border: none; }
input[type="range"]::-moz-range-thumb { background-color: #6366f1; height: 20px; width: 20px; border-radius: 50%; border: none; transition: all 0.2s ease; cursor: pointer; }
input[type="range"]::-moz-range-thumb:hover { transform: scale(1.1); background-color: #4f46e5; }
input[type="range"]:focus::-moz-range-thumb { box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2); }

/* Radius slider specific styling with color-coded ranges */
#radius-slider {
    --walking-color: #22c55e;      /* Green - 0-0.5km */
    --neighborhood-color: #86efac; /* Light Green - 0.5-2km */
    --city-color: #0ea5e9;         /* Sky Blue - 2-10km */
}
/* WebKit (Chrome, Safari, Edge) */
#radius-slider::-webkit-slider-runnable-track {
    background: linear-gradient(to left, 
        var(--walking-color) 0%, 
        var(--walking-color) 2.63%, 
        var(--neighborhood-color) 2.63%, 
        var(--neighborhood-color) 15.79%, 
        var(--city-color) 15.79%, 
        var(--city-color) 100%);
    height: 8px;
    border-radius: 4px;
}
#radius-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    margin-top: -4px;
    background-color: #6366f1; /* Primary action color */
    height: 20px;
    width: 20px;
    border-radius: 50%;
    transition: all 0.2s ease;
    cursor: pointer;
}
#radius-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background-color: #4f46e5; /* Darker primary on hover */
}
#radius-slider:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2); /* Primary color shadow */
}
/* Firefox */
#radius-slider::-moz-range-track {
    background: linear-gradient(to left, 
        var(--walking-color) 0%, 
        var(--walking-color) 2.63%, 
        var(--neighborhood-color) 2.63%, 
        var(--neighborhood-color) 15.79%, 
        var(--city-color) 15.79%, 
        var(--city-color) 100%);
    height: 8px;
    border-radius: 4px;
    border: none;
}
#radius-slider::-moz-range-thumb {
    background-color: #6366f1; /* Primary action color */
    height: 20px;
    width: 20px;
    border-radius: 50%;
    border: none;
    transition: all 0.2s ease;
    cursor: pointer;
}
#radius-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    background-color: #4f46e5; /* Darker primary on hover */
}
#radius-slider:focus::-moz-range-thumb {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2); /* Primary color shadow */
}

/* Persian Datepicker Theme - Compact Indigo */
.datepicker-plot-area { 
    font-family: 'Vazirmatn', sans-serif !important; 
    border-radius: 16px !important; 
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.15), 0 4px 10px -5px rgba(0, 0, 0, 0.05) !important; 
    border: 1px solid rgba(0,0,0,0.05) !important; 
    background: white !important;
    width: 290px !important;
    min-width: 290px !important;
    max-width: 290px !important;
    overflow: hidden !important;
}
.datepicker-plot-area.datepicker-state-no-meridian { min-height: auto !important; height: auto !important; }
.datepicker-navigator { 
    background: white !important; 
    padding: 12px 16px !important; 
    border-bottom: 1px solid #f3f4f6 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}
.datepicker-navigator .pwt-btn { 
    color: #4b5563 !important; 
    font-size: 14px !important; 
    background: #f9fafb !important;
    border-radius: 8px !important;
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s !important;
}
.datepicker-navigator .pwt-btn:hover { background: #f3f4f6 !important; color: #111827 !important; }
.datepicker-navigator .pwt-btn-switch { 
    color: #111827 !important;
    font-weight: 700 !important; 
    font-size: 15px !important; 
    background: transparent !important;
    padding: 0 8px !important;
}
.datepicker-grid-view { padding: 12px !important; }
.datepicker-grid-view .month-grid-box { height: auto !important; }
.datepicker-grid-view .month-grid-box .header { height: auto !important; margin-bottom: 8px !important; }
.datepicker-grid-view .month-grid-box .header .header-row-cell { 
    color: #9ca3af !important; 
    font-weight: 500 !important; 
    font-size: 12px !important; 
    padding: 4px 0 !important; 
    height: auto !important; 
}
.datepicker-day-view { height: auto !important; }
.datepicker-day-view table { height: auto !important; width: 100% !important; border-spacing: 0 4px !important; border-collapse: separate !important; }
.datepicker-day-view td { padding: 0 !important; height: auto !important; text-align: center !important; }
.datepicker-day-view td span { 
    width: 34px !important; 
    height: 34px !important; 
    line-height: 34px !important; 
    font-size: 13px !important; 
    color: #374151 !important; 
    cursor: pointer !important; 
    display: inline-block !important; 
    border-radius: 10px !important;
    transition: all 0.2s !important;
    border: 1px solid transparent !important;
}
.datepicker-day-view td span:hover { background: #f3f4f6 !important; color: #111827 !important; }
.datepicker-day-view .selected span, .datepicker-day-view .selected.other-month span { 
    background: #6366f1 !important; 
    color: white !important; 
    box-shadow: 0 4px 10px -2px rgba(99, 102, 241, 0.4) !important;
}
.datepicker-day-view .today span { 
    border: 1px solid #6366f1 !important; 
    background: #f5f3ff !important; 
    color: #6366f1 !important; 
    font-weight: 600 !important;
}
.datepicker-day-view .today.selected span { 
    background: #6366f1 !important; 
    color: white !important; 
    border: 1px solid transparent !important; 
}
.datepicker-day-view .other-month span { color: #d1d5db !important; }
.datepicker-day-view .disabled span { color: #e5e7eb !important; cursor: not-allowed !important; background: transparent !important; }
.datepicker-toolbox { 
    padding: 12px !important; 
    border-top: 1px solid #f3f4f6 !important; 
    height: auto !important; 
    background: #fafafa !important;
}
.pwt-btn-today { 
    background: white !important; 
    color: #4b5563 !important; 
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important; 
    padding: 8px 16px !important; 
    font-size: 12px !important; 
    line-height: 1 !important; 
    transition: all 0.2s !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    width: 100% !important;
}
.pwt-btn-today:hover {
    background: #f9fafb !important;
    border-color: #d1d5db !important;
    color: #111827 !important;
}
.datepicker-container { z-index: 9999 !important; }
@media (max-width: 640px) {
    .datepicker-plot-area { width: 280px !important; min-width: 280px !important; max-width: 280px !important; }
    .datepicker-day-view td span { width: 32px !important; height: 32px !important; line-height: 32px !important; }
}
/* Force compact on real mobile devices */
.datepicker-plot-area.datepicker-state-surface-bottom-sheet { 
    position: fixed !important; 
    height: auto !important; 
    max-height: none !important; 
    width: 100% !important; 
    min-width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    top: auto !important;
    border-radius: 20px 20px 0 0 !important;
    transform: none !important;
    padding-bottom: 20px !important;
}

/* Mobile Sidebar */
.mobile-sidebar { transform: translateX(100%); transition: transform 0.3s ease; }
.mobile-sidebar.open { transform: translateX(0); }
.mobile-backdrop { opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.mobile-backdrop.open { opacity: 1; visibility: visible; }

/* Mobile Bottom Nav */
.mobile-bottom-nav { box-shadow: 0 -4px 20px rgba(0,0,0,0.1); }
.mobile-step-dot { transition: all 0.2s ease; }
.mobile-step-dot.active { transform: scale(1.3); }
.mobile-step-dot.completed { background: #22c55e !important; }

/* Search Results Dropdown */
.search-result-item { transition: all 0.15s ease; cursor: pointer; }
.search-result-item:hover { background: #f3f4f6; }
.search-result-item:active { background: #e5e7eb; }

/* Custom Color Picker Popup */
.color-picker-wrapper { position: relative; display: inline-block; }
.color-picker-popup {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1000;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 16px;
    min-width: 220px;
    display: none;
}
.color-picker-popup.show {
    display: block;
}
.color-picker-popup input[type="color"] {
    width: 100%;
    height: 50px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
.color-picker-popup input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 6px;
}
.color-picker-popup input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}
.color-picker-popup input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 6px;
}
.color-picker-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    display: none;
}
.color-picker-backdrop.show {
    display: block;
}
.color-picker-popup input[type="text"] {
    width: 100%;
    margin-top: 12px;
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    text-align: center;
}

/* Steps Popover Menu */
#steps-popover-content.show {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}
.popover-step-item {
    transition: all 0.2s ease;
    cursor: pointer;
}
.popover-step-item:hover {
    background: #f3f4f6;
}
.popover-step-item.current {
    background: #eef2ff;
}
/* Popover step icon colors are set dynamically via JavaScript */
#steps-popover-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.1);
    display: none;
}
#steps-popover-backdrop.show {
    display: block;
}

/* Mobile Steps Popover */
#mobile-steps-popover-content.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}
.color-picker-popup input[type="text"]:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.color-picker-popup input[type="text"].error {
    border-color: #ef4444;
    background: #fef2f2;
}
.color-categories-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 640px) {
    .color-categories-container {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1024px) {
    .color-categories-container {
        grid-template-columns: repeat(3, 1fr);
    }
}
.color-category-section {
    margin-bottom: 0;
}
.color-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 6px;
}
.palette-info-btn {
    flex-shrink: 0;
    cursor: pointer;
    border: none;
    background: transparent;
}
.palette-info-btn:hover {
    background: #f3f4f6 !important;
    color: #374151 !important;
}
.palette-info-btn:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
    border-bottom: 1px solid #f3f4f6;
}
.color-category-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}
.color-category-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Custom Colors List */
.custom-colors-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}
.custom-colors-list:empty {
    display: none;
}
.custom-color-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}
.custom-color-item:hover {
    border-color: #d1d5db;
    background: #f3f4f6;
}
.custom-color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 2px solid white;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    cursor: pointer;
}
.custom-color-info {
    flex: 1;
    min-width: 0;
}
.custom-color-hex {
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    font-family: 'Courier New', monospace;
    margin-bottom: 4px;
}
.custom-color-name-input {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 13px;
    color: #1f2937;
    background: transparent;
    transition: all 0.2s ease;
}
.custom-color-name-input:focus {
    outline: none;
    border-color: #6366f1;
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.custom-color-name-input::placeholder {
    color: #9ca3af;
    font-style: italic;
}
.custom-color-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.custom-color-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
}
.custom-color-edit-btn {
    background: #eef2ff;
    color: #6366f1;
}
.custom-color-edit-btn:hover {
    background: #6366f1;
    color: white;
}
.custom-color-remove-btn {
    background: #fee2e2;
    color: #ef4444;
}
.custom-color-remove-btn:hover {
    background: #ef4444;
    color: white;
}
.color-picker-popup input[type="text"]#custom-color-name {
    width: 100%;
    margin-top: 12px;
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    color: #1f2937;
    transition: all 0.2s ease;
}
.color-picker-popup input[type="text"]#custom-color-name:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.color-picker-popup input[type="text"]#custom-color-name::placeholder {
    color: #9ca3af;
}
.color-picker-save-btn {
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.color-picker-save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}
.color-picker-save-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}
.color-picker-save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.color-picker-save-btn.success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}
.color-picker-save-btn.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* Color Info Modal */
.color-info-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.color-info-modal.show {
    display: flex;
}
.color-info-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}
.color-info-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.color-info-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.color-info-modal-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.color-info-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}
.color-info-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.color-info-modal-close:hover {
    background: #e5e7eb;
    color: #1f2937;
}
.color-info-modal-body {
    padding: 24px;
    background: white;
    color: #1f2937;
}
.color-info-category {
    margin-bottom: 24px;
    padding: 16px;
    border-radius: 12px;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
}
.color-info-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.color-info-category-colors {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.color-info-swatch {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 2px solid white;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}
.color-info-category-text {
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
}

/* Rich Content Styles */
.color-info-section {
    margin-bottom: 24px;
}
.color-info-section:last-child {
    margin-bottom: 0;
}
.color-info-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.color-info-section-title i {
    color: #6366f1;
    font-size: 14px;
}
.color-info-section-content {
    font-size: 14px;
    line-height: 1.8;
    color: #4b5563;
}
.color-info-list {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}
.color-info-list li {
    padding: 8px 24px 8px 0;
    position: relative;
    line-height: 1.7;
    color: #4b5563;
}
.color-info-list li:before {
    content: "•";
    position: absolute;
    right: 8px;
    color: #6366f1;
    font-weight: bold;
    font-size: 18px;
}
.color-info-tip {
    background: #eff6ff;
    border-right: 3px solid #3b82f6;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 12px 0;
}
.color-info-tip-title {
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 6px;
    font-size: 13px;
}
.color-info-tip-content {
    font-size: 13px;
    color: #1e3a8a;
    line-height: 1.6;
}
.color-info-warning {
    background: #fef3c7;
    border-right: 3px solid #f59e0b;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 12px 0;
}
.color-info-warning-title {
    font-weight: 600;
    color: #92400e;
    margin-bottom: 6px;
    font-size: 13px;
}
.color-info-warning-content {
    font-size: 13px;
    color: #78350f;
    line-height: 1.6;
}
.color-info-example {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 8px 0;
}
.color-info-example-title {
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
    font-size: 13px;
}
.color-info-example-content {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
}
.color-info-combinations {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}
.color-info-combination-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    color: #374151;
}
.color-info-combination-swatch {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Duration Info Modal */
.duration-info-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.duration-info-modal.show {
    display: flex;
}
.duration-info-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}
.duration-info-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: durationModalSlideIn 0.3s ease-out;
}
@keyframes durationModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.duration-info-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.duration-info-modal-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: #eef2ff;
    color: #6366f1;
}
.duration-info-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}
.duration-info-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
}
.duration-info-modal-close:hover {
    background: #e5e7eb;
    color: #1f2937;
}
.duration-info-modal-body {
    padding: 24px;
    background: white;
    color: #1f2937;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
}

/* Duration Modal Content Styles */
.duration-info-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f3f4f6;
}
.duration-info-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.duration-info-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
.duration-info-stat {
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 12px;
    padding: 14px 16px;
    text-align: center;
}
.duration-info-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}
.duration-info-stat-label {
    font-size: 12px;
    color: #6b7280;
}
.duration-info-section {
    margin-bottom: 20px;
}
.duration-info-section:last-child {
    margin-bottom: 0;
}
.duration-info-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.duration-info-section-title i {
    color: #6366f1;
    font-size: 13px;
}
.duration-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.duration-info-list li {
    padding: 8px 20px 8px 0;
    position: relative;
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
}
.duration-info-list li:before {
    content: "✓";
    position: absolute;
    right: 0;
    color: #10b981;
    font-weight: bold;
    font-size: 12px;
}
.duration-info-tip {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-right: 3px solid #6366f1;
    padding: 14px 16px;
    border-radius: 10px;
    margin-top: 16px;
}
.duration-info-tip-content {
    font-size: 13px;
    color: #4338ca;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.duration-info-tip-content i {
    margin-top: 2px;
    flex-shrink: 0;
}

/* Duration Card Specific Styles */
.duration-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.duration-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}
.duration-card.selected {
    border-color: #6366f1 !important;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%) !important;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.2);
}
.duration-card.selected:hover {
    transform: translateY(-2px);
}
.duration-info-btn {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.2s ease;
}
.duration-card:hover .duration-info-btn {
    opacity: 1;
    transform: scale(1);
}
.duration-info-btn:hover {
    background: #eef2ff !important;
}

/* Selected Color Palette */
.selected-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}
.selected-palette:empty {
    display: none;
}
.palette-color-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 20px;
    background: white;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
}
.palette-color-item:hover {
    border-color: #6366f1;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}
.palette-color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}
.palette-color-hex {
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    font-family: 'Vazirmatn', sans-serif;
}
.palette-color-remove {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fee2e2;
    color: #ef4444;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-size: 10px;
    padding: 0;
}
.palette-color-remove:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}
.palette-empty-message {
    text-align: center;
    padding: 20px;
    color: #9ca3af;
    font-size: 13px;
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 400px;
    margin: 0 auto;
}
@media (min-width: 640px) {
    .toast-container {
        top: 24px;
        left: auto;
        right: 24px;
    }
}
.toast {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-right: 4px solid;
    min-width: 280px;
    max-width: 100%;
}
.toast.show {
    transform: translateX(0);
    opacity: 1;
}
.toast.success {
    border-right-color: #22c55e;
}
.toast.error {
    border-right-color: #ef4444;
}
.toast.warning {
    border-right-color: #f59e0b;
}
.toast.info {
    border-right-color: #3b82f6;
}
.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
}
.toast.success .toast-icon {
    background: #dcfce7;
    color: #16a34a;
}
.toast.error .toast-icon {
    background: #fee2e2;
    color: #ef4444;
}
.toast.warning .toast-icon {
    background: #fef3c7;
    color: #f59e0b;
}
.toast.info .toast-icon {
    background: #dbeafe;
    color: #3b82f6;
}
.toast-content {
    flex: 1;
    min-width: 0;
}
.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 2px;
}
.toast-message {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}
.toast-close {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}
.toast-close:hover {
    background: #f3f4f6;
    color: #374151;
}
.toast-close:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Inline Error Messages */
.error-message {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 12px;
    color: #ef4444;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.2s ease;
}
.error-message.show {
    opacity: 1;
    transform: translateY(0);
}
.error-message i {
    font-size: 14px;
}
.field-error {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
}
.field-error:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}
.required-indicator {
    color: #ef4444;
    margin-right: 4px;
}

/* Skeleton Loaders */
.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}
.skeleton-text:last-child {
    margin-bottom: 0;
    width: 60%;
}
.skeleton-map {
    height: 280px;
    width: 100%;
    border-radius: 1rem;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}
.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #9ca3af;
}
.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}
.empty-state-message {
    font-size: 14px;
    color: #6b7280;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}
.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Enhanced Focus States */
*:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Active/Pressed States */
button:active:not(:disabled) {
    transform: scale(0.98);
}
.step-card:active {
    transform: translateY(-2px) scale(0.98);
}
.tag-btn:active {
    transform: scale(0.95);
}
.radius-preset:active,
.pace-btn:active,
.design-choice-btn:active,
.design-package-btn:active,
.style-pref-btn:active,
.urgency-btn:active {
    transform: scale(0.97);
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip Navigation Link */
.skip-nav {
    position: absolute;
    top: -40px;
    right: 0;
    background: #6366f1;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    z-index: 10000;
    transition: top 0.2s ease;
}
.skip-nav:focus {
    top: 0;
}

/* Tooltip System */
.tooltip-wrapper {
    position: relative;
    display: inline-block;
}
.tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 50%;
    transform: translateX(50%);
    background: #1f2937;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: normal; /* Allow wrapping */
    width: max-content;
    max-width: 200px; /* Restrict width */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 1000;
    line-height: 1.4;
    text-align: center;
}
.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 50%;
    transform: translateX(50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
}
.tooltip-wrapper:hover .tooltip,
.tooltip-wrapper:focus-within .tooltip {
    opacity: 1;
    visibility: visible;
}

/* Character Count */
.char-count {
    font-size: 11px;
    color: #9ca3af;
    text-align: left;
    margin-top: 4px;
}
.char-count.warning {
    color: #f59e0b;
}
.char-count.error {
    color: #ef4444;
}

/* Confirmation Modal */
.confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}
.confirmation-modal.show {
    display: flex;
}
.confirmation-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 400px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}
.confirmation-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
}
.confirmation-modal-message {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 24px;
    line-height: 1.6;
}
.confirmation-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

