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

:root {
    --bg-primary: #0b0c10;
    --bg-secondary: #171923;
    --bg-card: #202433;
    --bg-card-hover: #2a2f42;
    --border-color: #2d3247;
    --text-primary: #f7fafc;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    
    --color-accent: #6366f1;       /* Indigo */
    --color-accent-glow: rgba(99, 102, 241, 0.15);
    --color-success: #10b981;      /* Green */
    --color-success-glow: rgba(16, 185, 129, 0.2);
    --color-danger: #ef4444;       /* Red */
    --color-danger-glow: rgba(239, 68, 68, 0.2);
    --color-warning: #f59e0b;      /* Amber */
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 16px;
    --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

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

/* Glassmorphism Header */
header {
    background: rgba(23, 25, 35, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    color: var(--color-accent);
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-accent {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--color-accent);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Container */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: 1.2fr 0.8fr;
    }
}

/* Card Styling */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-premium);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.8), 0 0 15px var(--color-accent-glow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Input Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    background-color: rgba(11, 12, 16, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-glow);
    background-color: rgba(11, 12, 16, 0.8);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    width: 100%;
}

.btn-primary {
    background-color: var(--color-accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background-color: #5053de;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-success {
    background-color: var(--color-success);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background-color: #0d9668;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background-color: var(--color-danger);
    color: #fff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* Call Button - Circle pulse */
.btn-call {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--color-success);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
}

.btn-call:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--color-success-glow);
}

.btn-call.ringing {
    background-color: var(--color-danger);
    animation: ring-pulse 1.5s infinite;
}

@keyframes ring-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* List Items */
.list-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

/* Custom Scrollbar */
.list-container::-webkit-scrollbar {
    width: 6px;
}
.list-container::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}
.list-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: var(--transition-smooth);
}

.list-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.item-title {
    font-weight: 600;
    color: var(--text-primary);
}

.item-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Call Dialog / Simulation Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 12, 16, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* Call UI */
.caller-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent) 0%, #8b5cf6 100%);
    margin: 0 auto 1.5rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
    position: relative;
}

.caller-avatar.calling {
    animation: avatar-pulse 2s infinite;
}

@keyframes avatar-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7), 0 10px 25px rgba(99, 102, 241, 0.4);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(99, 102, 241, 0), 0 10px 25px rgba(99, 102, 241, 0.4);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0), 0 10px 25px rgba(99, 102, 241, 0.4);
    }
}

.call-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.call-status {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.call-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.btn-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-circle-decline {
    background-color: var(--color-danger);
    box-shadow: 0 8px 20px var(--color-danger-glow);
}

.btn-circle-decline:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.5);
}

.btn-circle-accept {
    background-color: var(--color-success);
    box-shadow: 0 8px 20px var(--color-success-glow);
}

.btn-circle-accept:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.5);
    animation: none;
}

.btn-circle-accept.incoming {
    animation: accept-pulse 1.2s infinite;
}

@keyframes accept-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

/* Audio waves animation during active call */
.audio-waves {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 30px;
    margin-bottom: 2rem;
}

.audio-bar {
    width: 4px;
    height: 100%;
    background-color: var(--color-success);
    border-radius: 2px;
    animation: audio-wave-pulse 1.2s ease-in-out infinite alternate;
}

.audio-bar:nth-child(2) { animation-delay: 0.15s; }
.audio-bar:nth-child(3) { animation-delay: 0.3s; }
.audio-bar:nth-child(4) { animation-delay: 0.45s; }
.audio-bar:nth-child(5) { animation-delay: 0.6s; }

@keyframes audio-wave-pulse {
    0% { height: 6px; }
    100% { height: 28px; }
}

/* App Simulator Frame for Condominio View */
.phone-simulator {
    width: 100%;
    max-width: 412px;
    height: 820px;
    border: 12px solid #2d3247;
    border-radius: 40px;
    margin: 0 auto;
    background-color: var(--bg-primary);
    overflow: hidden;
    position: relative;
    box-shadow: 0 30px 60px -15px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
}

.phone-screen {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.phone-header {
    background-color: var(--bg-secondary);
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.phone-body {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.phone-nav {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.nav-item.active {
    color: var(--color-accent);
}

.nav-item svg {
    width: 20px;
    height: 20px;
}

/* PWA Install Banner */
.install-banner {
    background: linear-gradient(135deg, var(--color-accent) 0%, #4f46e5 100%);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.install-banner-text {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
}

.install-banner .btn {
    background-color: white;
    color: var(--color-accent);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.install-banner .btn:hover {
    background-color: #f7fafc;
    box-shadow: 0 4px 12px rgba(255,255,255,0.2);
}
