/* Custom Styles for AutoGeolocation Dashboard */

:root {
    --brand-primary: #3b82f6;
    --brand-blue: #3b82f6;
    --brand-yellow: #f59e0b;
    --brand-green: #10b981;
    --brand-red: #ef4444;
    --brand-gray: #6b7280;
    --brand-text-primary: #111827;
    --brand-text-secondary: #6b7280;
    --brand-text-tertiary: #9ca3af;
    --brand-border: #e5e7eb;
    --brand-background: #f9fafb;
    --brand-surface: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    color: var(--brand-text-primary);
    background-color: var(--brand-background);
}

.font-mono {
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--brand-background);
}

::-webkit-scrollbar-thumb {
    background: var(--brand-border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brand-text-tertiary);
}

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

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes locationArrive {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

@keyframes greenPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes gentleBob {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes timeoutPulse {
    0%, 100% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

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

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

.animate-bounce-in {
    animation: bounceIn 0.5s ease-out;
}

.animate-location-arrive {
    animation: locationArrive 0.6s ease-out;
}

.animate-green-pulse {
    animation: greenPulse 2s infinite;
}

.animate-gentle-bob {
    animation: gentleBob 3s ease-in-out infinite;
}

.animate-timeout-pulse {
    animation: timeoutPulse 2s ease-in-out infinite;
}

/* Status Styles */
.status-new {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--brand-blue);
    border: 1px solid rgba(59, 130, 246, 0.5);
}

.status-sms-sent {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--brand-yellow);
    border: 1px solid rgba(245, 158, 11, 0.5);
}

.status-location-received {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--brand-green);
    border: 1px solid rgba(16, 185, 129, 0.5);
}

.status-closed {
    background-color: rgba(107, 114, 128, 0.1);
    color: var(--brand-gray);
    border: 1px solid rgba(107, 114, 128, 0.5);
}

/* Message Bubbles */
.message-bubble {
    animation: fadeIn 0.3s ease-in-out;
}

.message-bubble.operator {
    background-color: var(--brand-primary);
    color: white;
}

.message-bubble.caller {
    background-color: #f3f4f6;
    color: var(--brand-text-primary);
}

.message-bubble.confirmation {
    animation: locationArrive 0.6s ease-out;
}

/* Call Control States */
.call-connecting {
    background-color: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--brand-yellow);
}

.call-active {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--brand-red);
}

.call-on-hold {
    background-color: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--brand-blue);
}

/* Map Container */
#map {
    border-radius: 0.75rem;
    overflow: hidden;
}

/* Transcript Styling */
#transcript-container {
    font-family: 'Fira Code', 'Consolas', monospace;
    line-height: 1.4;
}

.transcript-line {
    margin-bottom: 0.25rem;
}

.transcript-line:last-child {
    margin-bottom: 0;
}

.transcript-operator {
    color: #22d3ee;
    font-weight: 600;
}

.transcript-caller {
    color: #fbbf24;
}

/* Phone Number Formatting */
.phone-number {
    letter-spacing: 0.025em;
}

/* Time Formatting */
.time-ago {
    color: var(--brand-text-secondary);
    font-size: 0.75rem;
}

/* Recent Numbers Dropdown */
.recent-number-item:hover {
    background-color: var(--brand-background);
}

.recent-number-item:active {
    background-color: var(--brand-primary);
    color: white;
}

/* Timeout States */
.sms-alert-timeout {
    background-color: rgba(251, 191, 36, 0.1) !important;
    border-color: rgba(251, 191, 36, 0.3) !important;
}

.sms-alert-timeout .text-brand-text-secondary {
    color: #d97706 !important;
}

/* Loading States */
.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Button States */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button:active {
    transform: scale(0.98);
}

/* Focus States */
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

/* Modal Backdrop */
.modal-backdrop {
    backdrop-filter: blur(4px);
    background-color: rgba(0, 0, 0, 0.5);
}

/* Language Dropdown */
#language-dropdown {
    z-index: 50;
}

.language-option:hover {
    background-color: var(--brand-background);
}

/* Case List Items */
.case-list-item {
    transition: all 0.2s ease-in-out;
    border-bottom: 1px solid var(--brand-border);
}

.case-list-item:hover {
    background-color: var(--brand-background);
}

.case-list-item.selected {
    background-color: rgba(59, 130, 246, 0.1);
    border-left: 4px solid var(--brand-primary);
}

/* Status Indicators */
.status-indicator {
    position: relative;
}

.status-indicator.active {
    animation: pulse 2s infinite;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .case-list-item {
        padding: 1rem;
    }
    
    #map-container {
        aspect-ratio: 16/9;
    }
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }
    
    #case-detail {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
        background-color: white;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.block {
    display: block !important;
}

.flex {
    display: flex !important;
}

.relative {
    position: relative !important;
}

.absolute {
    position: absolute !important;
}

.fixed {
    position: fixed !important;
}

.overflow-hidden {
    overflow: hidden !important;
}

.overflow-y-auto {
    overflow-y: auto !important;
}

.text-center {
    text-align: center !important;
}

.font-bold {
    font-weight: 700 !important;
}

.font-semibold {
    font-weight: 600 !important;
}

.font-mono {
    font-family: 'Fira Code', monospace !important;
}

.text-xs {
    font-size: 0.75rem !important;
}

.text-sm {
    font-size: 0.875rem !important;
}

.text-lg {
    font-size: 1.125rem !important;
}

.text-xl {
    font-size: 1.25rem !important;
}

.text-2xl {
    font-size: 1.5rem !important;
}

.text-3xl {
    font-size: 1.875rem !important;
}

.uppercase {
    text-transform: uppercase !important;
}

.tracking-tighter {
    letter-spacing: -0.05em !important;
}

.transition-all {
    transition: all 0.3s ease !important;
}

.transition-colors {
    transition: color 0.3s ease, background-color 0.3s ease !important;
}

.duration-300 {
    transition-duration: 300ms !important;
}

.duration-500 {
    transition-duration: 500ms !important;
}

.duration-700 {
    transition-duration: 700ms !important;
}

.ease-in-out {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.ease-out {
    transition-timing-function: cubic-bezier(0, 0, 0.2, 1) !important;
}

/* Custom Tailwind Extensions */
.bg-brand-primary {
    background-color: var(--brand-primary) !important;
}

.bg-brand-blue {
    background-color: var(--brand-blue) !important;
}

.bg-brand-yellow {
    background-color: var(--brand-yellow) !important;
}

.bg-brand-green {
    background-color: var(--brand-green) !important;
}

.bg-brand-red {
    background-color: var(--brand-red) !important;
}

.bg-brand-gray {
    background-color: var(--brand-gray) !important;
}

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

.bg-brand-surface {
    background-color: var(--brand-surface) !important;
}

.text-brand-primary {
    color: var(--brand-primary) !important;
}

.text-brand-blue {
    color: var(--brand-blue) !important;
}

.text-brand-yellow {
    color: var(--brand-yellow) !important;
}

.text-brand-green {
    color: var(--brand-green) !important;
}

.text-brand-red {
    color: var(--brand-red) !important;
}

.text-brand-gray {
    color: var(--brand-gray) !important;
}

.text-brand-text-primary {
    color: var(--brand-text-primary) !important;
}

.text-brand-text-secondary {
    color: var(--brand-text-secondary) !important;
}

.text-brand-text-tertiary {
    color: var(--brand-text-tertiary) !important;
}

.border-brand-border {
    border-color: var(--brand-border) !important;
}

.ring-brand-primary {
    --tw-ring-color: rgba(59, 130, 246, 0.5) !important;
}