@layer base {
  :root {
    --background: 240 10% 3.9%;
    --foreground: 0 0% 98%;
    --card: 240 10% 3.9%;
    --card-foreground: 0 0% 98%;
    --popover: 240 10% 3.9%;
    --popover-foreground: 0 0% 98%;
    --primary: 0 0% 98%;
    --primary-foreground: 240 5.9% 10%;
    --secondary: 240 3.7% 15.9%;
    --secondary-foreground: 0 0% 98%;
    --muted: 240 3.7% 15.9%;
    --muted-foreground: 240 5% 64.9%;
    --accent: 240 3.7% 15.9%;
    --accent-foreground: 0 0% 98%;
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 0 0% 98%;
    --border: 240 3.7% 15.9%;
    --input: 240 3.7% 15.9%;
    --ring: 240 4.9% 83.9%;
    --radius: 0.5rem;
  }
}

#transcript::-webkit-scrollbar,
#templatesList::-webkit-scrollbar {
    width: 6px;
}

#transcript::-webkit-scrollbar-track,
#templatesList::-webkit-scrollbar-track {
    background: transparent;
}

#transcript::-webkit-scrollbar-thumb,
#templatesList::-webkit-scrollbar-thumb {
    background: hsl(var(--border));
    border-radius: 3px;
}

#transcript::-webkit-scrollbar-thumb:hover,
#templatesList::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--muted-foreground) / 0.3);
}

.message {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border-left: 3px solid transparent;
    animation: slideIn 0.3s ease-out;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.message:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.message.copied {
    animation: copyPulse 0.5s ease;
}

@keyframes copyPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); box-shadow: 0 0 20px rgba(34, 197, 94, 0.4); }
    100% { transform: scale(1); }
}

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

.message .time {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.message .text {
    color: hsl(var(--foreground));
    line-height: 1.6;
    display: flex;
    align-items: center;
    gap: 6px;
}

.message-icon {
    display: inline-flex;
    align-items: center;
    opacity: 0.8;
}

.message-icon svg {
    flex-shrink: 0;
}

* {
    border-color: hsl(var(--border));
}

body {
    font-feature-settings: "rlig" 1, "calt" 1;
}

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

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

.animate-slide-in {
    animation: slide-in 0.3s ease-out;
}

.message.system {
    background: hsl(var(--accent));
    border-left-color: hsl(var(--primary));
}

.message.user {
    background: hsl(var(--secondary));
    border-left-color: hsl(var(--primary));
}

.message.ai {
    background: hsl(var(--muted));
    border-left-color: hsl(var(--primary));
}

.message.caller {
    background: linear-gradient(to right, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.15) 100%);
    border-left-color: #f59e0b;
}

.message.interim {
    background: hsl(var(--muted) / 0.5);
    border-left-color: hsl(var(--muted-foreground));
    opacity: 0.7;
    font-style: italic;
}

.message.translation {
    background: linear-gradient(to right, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.15) 100%);
    border-left-color: #3b82f6;
    margin-left: 1.5rem;
    margin-top: -0.5rem;
    font-size: 0.875rem;
}

.message.translation-error {
    background: linear-gradient(to right, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.15) 100%);
    border-left-color: #ef4444;
    margin-left: 1.5rem;
    margin-top: -0.5rem;
    font-size: 0.875rem;
    opacity: 0.8;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: hsl(var(--secondary));
    border-radius: 4px;
    outline: none;
    opacity: 1;
}

.volume-slider::-webkit-slider-track {
    width: 100%;
    height: 8px;
    background: hsl(var(--secondary));
    border-radius: 4px;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: hsl(var(--primary));
    cursor: pointer;
    border: 2px solid hsl(var(--background));
    box-shadow: 0 0 0 0 hsl(var(--primary) / 0);
    transition: all 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 6px hsl(var(--primary) / 0.15);
}

.volume-slider::-webkit-slider-thumb:active {
    transform: scale(1.05);
    box-shadow: 0 0 0 8px hsl(var(--primary) / 0.25);
}

.volume-slider::-moz-range-track {
    width: 100%;
    height: 8px;
    background: hsl(var(--secondary));
    border-radius: 4px;
}

.volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: 2px solid hsl(var(--background));
    border-radius: 50%;
    background: hsl(var(--primary));
    cursor: pointer;
    box-shadow: 0 0 0 0 hsl(var(--primary) / 0);
    transition: all 0.2s ease;
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 6px hsl(var(--primary) / 0.15);
}

.volume-slider::-moz-range-thumb:active {
    transform: scale(1.05);
    box-shadow: 0 0 0 8px hsl(var(--primary) / 0.25);
}

.volume-slider::-moz-range-progress {
    background: hsl(var(--primary) / 0.3);
    height: 8px;
    border-radius: 4px;
}

.custom-select {
    position: relative;
}

.custom-select select {
    background-image: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-select select::-ms-expand {
    display: none;
}

.custom-select select:hover {
    background: linear-gradient(135deg, hsl(var(--muted)) 0%, hsl(var(--background)) 100%);
    border-color: hsl(var(--ring) / 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.custom-select select:focus {
    box-shadow: 0 0 0 3px hsl(var(--ring) / 0.2), 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: hsl(var(--primary));
}

.custom-select::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid currentColor;
    pointer-events: none;
    opacity: 0.7;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.custom-select:hover::after {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.custom-select select:active ~ svg,
.custom-select select:focus ~ svg {
    opacity: 1;
    color: hsl(var(--primary));
    transform: translateY(-50%) rotate(180deg);
    transition: transform 0.3s ease;
}

.custom-select svg {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-select:hover svg {
    opacity: 1;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

select option {
    background-color: hsl(var(--card));
    color: hsl(var(--card-foreground));
    padding: 10px 12px;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin: 2px 4px;
}

select option:hover {
    background: linear-gradient(135deg, hsl(var(--primary) / 0.2) 0%, hsl(var(--primary) / 0.05) 100%);
    color: hsl(var(--primary));
    transform: translateX(2px);
}

select option:checked {
    background: linear-gradient(135deg, hsl(var(--primary) / 0.3) 0%, hsl(var(--primary) / 0.1) 100%);
    color: hsl(var(--primary));
    font-weight: 600;
}

select optgroup {
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: hsl(var(--muted-foreground));
    background: linear-gradient(135deg, hsl(var(--muted)) 0%, hsl(var(--card)) 100%);
    padding: 8px 12px;
    margin: 4px;
    border-radius: 4px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.animate-in {
    animation: fadeIn 0.2s ease-out, zoomIn 0.2s ease-out;
}

#callerIdDropdown,
#destinationDropdown,
#languageDropdown,
#ttsVoiceDropdown,
#cryptoDropdown,
#regionDropdown,
#typeDropdown {
    animation: dropdownSlideIn 0.15s ease-out;
    scrollbar-width: thin;
    scrollbar-color: hsl(var(--primary) / 0.3) transparent;
    overflow-x: hidden;
    overflow-y: auto;
}

#callerIdDropdown::-webkit-scrollbar,
#destinationDropdown::-webkit-scrollbar,
#languageDropdown::-webkit-scrollbar,
#ttsVoiceDropdown::-webkit-scrollbar,
#cryptoDropdown::-webkit-scrollbar,
#regionDropdown::-webkit-scrollbar,
#typeDropdown::-webkit-scrollbar {
    width: 8px;
}

#callerIdDropdown::-webkit-scrollbar-track,
#destinationDropdown::-webkit-scrollbar-track,
#languageDropdown::-webkit-scrollbar-track,
#ttsVoiceDropdown::-webkit-scrollbar-track,
#cryptoDropdown::-webkit-scrollbar-track,
#regionDropdown::-webkit-scrollbar-track,
#typeDropdown::-webkit-scrollbar-track {
    background: hsl(var(--muted));
    border-radius: 4px;
    margin: 4px 0;
}

#callerIdDropdown::-webkit-scrollbar-thumb,
#destinationDropdown::-webkit-scrollbar-thumb,
#languageDropdown::-webkit-scrollbar-thumb,
#ttsVoiceDropdown::-webkit-scrollbar-thumb,
#cryptoDropdown::-webkit-scrollbar-thumb,
#regionDropdown::-webkit-scrollbar-thumb,
#typeDropdown::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, hsl(var(--primary) / 0.5), hsl(var(--primary) / 0.3));
    border-radius: 4px;
    border: 2px solid hsl(var(--card));
    transition: all 0.3s ease;
}

#callerIdDropdown::-webkit-scrollbar-thumb:hover,
#destinationDropdown::-webkit-scrollbar-thumb:hover,
#languageDropdown::-webkit-scrollbar-thumb:hover,
#ttsVoiceDropdown::-webkit-scrollbar-thumb:hover,
#cryptoDropdown::-webkit-scrollbar-thumb:hover,
#regionDropdown::-webkit-scrollbar-thumb:hover,
#typeDropdown::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, hsl(var(--primary) / 0.7), hsl(var(--primary) / 0.5));
    border-color: hsl(var(--primary) / 0.3);
}

#callerIdDropdown::-webkit-scrollbar-thumb:active,
#destinationDropdown::-webkit-scrollbar-thumb:active,
#languageDropdown::-webkit-scrollbar-thumb:active,
#ttsVoiceDropdown::-webkit-scrollbar-thumb:active,
#cryptoDropdown::-webkit-scrollbar-thumb:active,
#regionDropdown::-webkit-scrollbar-thumb:active,
#typeDropdown::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, hsl(var(--primary)), hsl(var(--primary) / 0.7));
}

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

.contact-item {
    position: relative;
}

.contact-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 0;
    background: linear-gradient(to bottom, hsl(var(--primary)), transparent);
    transition: height 0.2s ease;
}

.contact-item:hover::before {
    height: 100%;
}

.contact-item:active {
    transform: scale(0.98);
}

.dropdown-item {
    position: relative;
    transition: all 0.2s ease;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 0;
    background: linear-gradient(to bottom, hsl(var(--primary)), transparent);
    transition: height 0.2s ease;
}

.dropdown-item:hover::before {
    height: 100%;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, hsl(var(--accent)) 0%, hsl(var(--card)) 100%);
    transform: translateX(2px);
}

.dropdown-item:active {
    transform: scale(0.98) translateX(2px);
}

button[id$="Btn"] svg,
button[id$="Button"] svg {
    transition: transform 0.3s ease;
}

button[aria-expanded="true"] svg {
    transform: rotate(180deg);
}


button[onclick*="saveCallerIdContact"],
button[onclick*="saveDestinationContact"] {
    transition: all 0.2s ease;
}

button[onclick*="saveCallerIdContact"]:hover,
button[onclick*="saveDestinationContact"]:hover {
    transform: scale(1.05);
}

button[onclick*="saveCallerIdContact"]:active,
button[onclick*="saveDestinationContact"]:active {
    transform: scale(0.95);
}
