@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;500;600;700&display=swap');

:root {
    --color1: #000000;
    --color2: #1ec3ea;
    --color3: #a6988a;
    --color4: #4bb4ca;
    --color5: #ffffff;
    
    --bg-primary: #0a0a0c;
    --bg-card: rgba(18, 18, 22, 0.7);
    --bg-card-hover: rgba(26, 26, 32, 0.9);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(30, 195, 234, 0.2);
    
    --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-primary);
    color: var(--color5);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Glassmorphism Card Utilities */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: rgba(30, 195, 234, 0.25);
    box-shadow: 0 12px 40px 0 rgba(30, 195, 234, 0.1);
}

/* Container limits */
.app-container {
    width: 100%;
    max-width: 500px; /* Mobile first / centered view */
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    justify-content: center;
}

.app-container.wide {
    max-width: 1000px;
}

/* Header & Logo */
.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo-img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--color2);
    box-shadow: 0 0 15px var(--border-glow);
    transition: var(--transition-smooth);
}

.logo-img:hover {
    transform: rotate(5deg) scale(1.05);
}

.app-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color5);
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.app-title span {
    color: var(--color2);
}

.app-subtitle {
    font-size: 0.85rem;
    color: var(--color3);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-top: 4px;
}

/* Login PIN inputs */
.pin-wrapper {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 24px 0;
}

.pin-input {
    width: 55px;
    height: 60px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1.8rem;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--color5);
    text-align: center;
    transition: var(--transition-smooth);
}

.pin-input:focus {
    outline: none;
    border-color: var(--color2);
    box-shadow: 0 0 10px rgba(30, 195, 234, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

/* Buttons and Controls */
.btn-primary {
    background: linear-gradient(135deg, var(--color2), var(--color4));
    color: var(--color1);
    font-family: var(--font-display);
    font-weight: 600;
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(30, 195, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 195, 234, 0.5);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: var(--color3);
    border: 1px solid var(--color3);
    border-radius: 12px;
    padding: 12px 24px;
    font-family: var(--font-display);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 100%;
    text-align: center;
}

.btn-secondary:hover {
    background: rgba(166, 152, 138, 0.1);
    color: var(--color5);
    border-color: var(--color5);
}

.btn-danger {
    background: #ef4444;
    color: var(--color5);
    border: none;
    border-radius: 12px;
    padding: 14px 24px;
    font-family: var(--font-display);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

/* User Specialty Buttons */
.specialty-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 20px 0;
}

.specialty-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.specialty-card:hover {
    border-color: var(--color2);
    transform: translateX(4px);
    background: rgba(30, 195, 234, 0.05);
}

.specialty-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.specialty-icon {
    width: 48px;
    height: 48px;
    background: rgba(30, 195, 234, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color2);
    font-size: 1.3rem;
}

.specialty-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 500;
}

.specialty-arrow {
    color: var(--color3);
    transition: var(--transition-smooth);
}

.specialty-card:hover .specialty-arrow {
    color: var(--color2);
    transform: translateX(3px);
}

/* QR Screen */
.payment-box {
    text-align: center;
    padding: 24px;
}

.payment-title {
    color: var(--color3);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.payment-price {
    font-size: 2.2rem;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--color2);
    margin-bottom: 20px;
}

.qr-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    display: inline-block;
    margin-bottom: 24px;
}

.qr-img {
    max-width: 220px;
    width: 100%;
    border-radius: 10px;
    display: block;
}

/* WebRTC Call Video Layout */
.video-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

@media(min-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.video-container {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 4/3;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.video-element {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* mirror self */
}

#remoteVideo {
    transform: none; /* do not mirror doctor */
}

.video-label {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-family: var(--font-display);
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.1);
}

.call-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 10px;
}

.btn-control {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.05);
    color: var(--color5);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.btn-control:hover {
    background: rgba(255,255,255,0.15);
    border-color: var(--color2);
}

.btn-control.active {
    background: #ef4444;
    border-color: #ef4444;
}

/* Scheduler & Form */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color3);
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--color5);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.form-control:focus {
    outline: none;
    border-color: var(--color2);
    box-shadow: 0 0 8px rgba(30, 195, 234, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

/* Lawyer main page styling */
.lawyer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    width: 100%;
}

@media(min-width: 900px) {
    .lawyer-grid {
        grid-template-columns: 350px 1fr;
    }
}

/* Waiting Room and Queue List */
.queue-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.queue-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: var(--transition-smooth);
}

@media(min-width: 500px) {
    .queue-item {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.queue-item:hover {
    border-color: var(--color4);
    background: rgba(255, 255, 255, 0.04);
}

.queue-user-info {
    display: flex;
    flex-direction: column;
}

.queue-user-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
}

.queue-user-meta {
    font-size: 0.8rem;
    color: var(--color3);
    margin-top: 4px;
}

.queue-actions {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 8px;
    border: none;
    font-family: var(--font-display);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-sm.accept {
    background: var(--color2);
    color: var(--color1);
}

.btn-sm.accept:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 10px rgba(30,195,234,0.4);
}

.btn-sm.reject {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.btn-sm.reject:hover {
    background: #ef4444;
    color: var(--color5);
}

/* Scheduler / Slots configuration view */
.slots-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.slot-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: 10px;
}

/* Switch Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--color2);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Nav header */
.nav-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(10, 10, 12, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo-side {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--color2);
}

.nav-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-user-info {
    text-align: right;
    display: none;
}

@media(min-width: 500px) {
    .nav-user-info {
        display: block;
    }
}

.nav-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color5);
}

.nav-user-role {
    font-size: 0.7rem;
    color: var(--color3);
}

.btn-logout {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--color5);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #fca5a5;
}

/* Call duration counter */
.call-timer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(30, 195, 234, 0.1);
    color: var(--color2);
    border: 1px solid rgba(30, 195, 234, 0.2);
    padding: 6px 14px;
    border-radius: 20px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

/* Custom SweetAlert themes */
.swal2-popup.aurajus-alert {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 16px !important;
    color: var(--color5) !important;
}

.swal2-title.aurajus-alert-title {
    font-family: var(--font-display) !important;
    color: var(--color5) !important;
}

.swal2-html-container.aurajus-alert-html {
    color: var(--color3) !important;
}

/* Tab systems */
.tab-container {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    gap: 16px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--color3);
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 10px 4px;
    cursor: pointer;
    position: relative;
    transition: var(--transition-smooth);
}

.tab-btn:hover {
    color: var(--color5);
}

.tab-btn.active {
    color: var(--color2);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color2);
    box-shadow: 0 0 8px var(--color2);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Loading animations */
.pulse-loader {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(30, 195, 234, 0.15);
    border: 2px solid var(--color2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 40px auto;
    position: relative;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(30, 195, 234, 0.4);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(30, 195, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(30, 195, 234, 0);
    }
}
