/**
 * =====================================================
 * STYLE.CSS - Modern Oto Kurtarma Tasarımı
 * =====================================================
 * Version: 1.0
 * Author: Professional Design Team
 * =====================================================
 */

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #00d4ff;
    --primary-dark: #00b8e6;
    --secondary: #6c5ce7;
    --accent: #00ffb3;
    --dark: #0a0e27;
    --dark-light: #1a1f3a;
    --success: #00ffb3;
    --wa: #25D366;
    --danger: #ff3366;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 50px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 40px rgba(0,212,255,0.4);
    --shadow-cyan: 0 0 60px rgba(0,212,255,0.6);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #2d1b69 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* ===== ANIMATED BACKGROUND ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(0,212,255,0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0,255,179,0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 20%, rgba(108,92,231,0.1) 0%, transparent 50%);
    animation: backgroundMove 20s ease infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes backgroundMove {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, 30px) scale(1.1); }
}

/* ===== CHAT WIDGET ===== */
.chat-widget {
    position: relative;
    width: 100%;
    max-width: 420px;
    height: 700px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255,255,255,0.2);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(50px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== HEADER ===== */
.header {
    background: linear-gradient(135deg, var(--dark-light) 0%, var(--dark) 100%);
    border-bottom: 2px solid var(--primary);
    padding: 24px 24px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: white;
    position: relative;
    box-shadow: 0 8px 32px rgba(0,212,255,0.2);
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 50%, var(--primary) 100%);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
    box-shadow: 0 0 20px var(--primary);
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.header-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s ease infinite;
    box-shadow: 0 0 20px rgba(0,212,255,0.5);
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 0 20px rgba(0,212,255,0.5), 0 0 0 0 rgba(0,212,255,0.7);
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: 0 0 30px rgba(0,212,255,0.7), 0 0 0 15px rgba(0,212,255,0);
    }
}

.header-icon svg {
    width: 32px;
    height: 32px;
    fill: var(--dark);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.header-text h1 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin: 0 0 4px 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.header-text .status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0.95;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: blink 2s ease infinite;
    box-shadow: 0 0 10px var(--accent);
}

@keyframes blink {
    0%, 100% { 
        opacity: 1; 
        box-shadow: 0 0 10px var(--accent);
    }
    50% { 
        opacity: 0.4; 
        box-shadow: 0 0 5px var(--accent);
    }
}

/* ===== CHAT BODY ===== */
.body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: linear-gradient(to bottom, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

.body::-webkit-scrollbar {
    width: 6px;
}

.body::-webkit-scrollbar-track {
    background: transparent;
}

.body::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--primary), var(--primary-dark));
    border-radius: 10px;
}

/* ===== MESSAGES ===== */
.msg {
    padding: 16px 18px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    max-width: 85%;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    word-wrap: break-word;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.bot {
    background: white;
    color: #2d3748;
    align-self: flex-start;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.05);
}

.bot::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 20px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid white;
}

.user {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    align-self: flex-end;
    box-shadow: var(--shadow-md), 0 0 20px rgba(0,212,255,0.3);
    font-weight: 500;
    border: 1px solid rgba(0,212,255,0.3);
}

.user::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 20px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid var(--secondary);
}

.loading-msg {
    background: linear-gradient(90deg, #e9ecef 0%, #f8f9fa 50%, #e9ecef 100%);
    background-size: 200% 100%;
    animation: loadingBg 2s linear infinite, slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    color: #6c757d;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 10px;
}

@keyframes loadingBg {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.pulsing svg {
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== DRIVER CARD ===== */
.driver-card {
    background: white;
    border: 1px solid rgba(0, 212, 255, 0.2);
    padding: 20px;
    border-radius: 20px;
    margin-top: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05), 0 0 1px rgba(0,212,255,0.2);
    animation: cardAppear 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.driver-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
}

@keyframes cardAppear {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card-header h3 {
    margin: 0 0 10px 0;
    color: var(--dark);
    font-size: 18px;
    font-weight: 800;
    display: flex;
    align-items: center;
    letter-spacing: -0.5px;
}

.driver-card .location {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.arrival-badge {
    margin-top: 18px;
    padding: 10px 14px;
    background: #f0f9ff;
    border-radius: 12px;
    font-size: 13px;
    color: #0369a1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    border: 1px solid #e0f2fe;
}

.arrival-badge svg {
    color: var(--primary);
}

.rating-line {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0 0 20px 0;
    font-size: 14px;
    color: #4b5563;
    font-weight: 500;
}

.stars {
    color: #f59e0b;
    font-size: 16px;
    letter-spacing: 2px;
}

.arrival-note-bottom {
    margin-top: 10px;
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.4;
    text-align: left;
}

/* ===== ACTION BUTTONS ===== */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-call, .btn-wa {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: white;
    text-decoration: none;
    padding: 16px 20px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    text-transform: uppercase;
}

.btn-call {
    background: #0f172a;
    box-shadow: 0 10px 20px -5px rgba(15, 23, 42, 0.3);
}

.btn-call:hover {
    background: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(15, 23, 42, 0.4);
}

.btn-wa {
    background: #25D366;
    box-shadow: 0 10px 20px -5px rgba(37, 211, 102, 0.3);
}

.btn-wa:hover {
    background: #22c35e;
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(37, 211, 102, 0.4);
}

.btn-call:active, .btn-wa:active {
    transform: translateY(0);
}

/* ===== LOCATION BUTTON ===== */
.location-request-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--dark);
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 20px rgba(0,212,255,0.4), 0 0 30px rgba(0,212,255,0.2);
}

.location-request-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(0,212,255,0.6), 0 0 40px rgba(0,212,255,0.3);
}

.location-request-btn:active {
    transform: translateY(0);
}

.location-request-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ===== INPUT AREA ===== */
.input-area {
    padding: 20px;
    background: white;
    display: flex;
    gap: 12px;
    border-top: 1px solid #e9ecef;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
}

#userInput {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    outline: none;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s;
    background: #f8f9fa;
}

#userInput:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(0,212,255,0.1);
}

.send-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    padding: 0 24px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 20px rgba(0,212,255,0.4);
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(0,212,255,0.6);
}

.send-btn:active {
    transform: scale(0.95);
}

/* ===== ICONS ===== */
.icon-svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.icon-sm {
    width: 18px;
    height: 18px;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 480px) {
    body {
        padding: 0;
    }
    
    .chat-widget {
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
    }
}

/* ===== SYSTEM NOTE ===== */
.system-note {
    margin-top: 8px;
    font-size: 11px;
    color: #adb5bd;
    font-style: italic;
    padding: 8px 12px;
    background: rgba(0,0,0,0.02);
    border-radius: 8px;
    border-left: 3px solid #dee2e6;
}

/* ===== FOOTER CREDIT ===== */
.footer-credit {
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
    border-top: 1px solid rgba(0,212,255,0.2);
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-credit a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 11px;
    transition: all 0.3s ease;
}

.footer-credit a:hover {
    color: var(--primary);
    transform: translateY(-1px);
}

.footer-credit a svg {
    stroke: var(--primary);
    animation: pulse 2s ease infinite;
}

.footer-credit a strong {
    color: white;
    font-weight: 600;
    letter-spacing: 0.3px;
}
