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

:root {
    /* Color Palette */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #10b981;
    --accent: #f59e0b;

    /* Backgrounds */
    --bg-dark: #020617;
    --bg-card: rgba(15, 23, 42, 0.6);
    --bg-sidebar: #0f172a;

    /* Borders & Glass */
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --glass: backdrop-filter: blur(16px);

    /* Text */
    --text-white: #f8fafc;
    --text-gray: #94a3b8;
    --text-muted: #64748b;

    /* Layout */
    --sidebar-width: 280px;
    --top-nav-height: 72px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- Layout Elements --- */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- Buttons --- */

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
}

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text-white);
}

.btn-outline:hover {
    border-color: var(--primary-light);
    background: rgba(99, 102, 241, 0.05);
}

/* --- Landing Page --- */

.navbar {
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(12px);
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero {
    padding: 8rem 0;
    text-align: center;
    position: relative;
}

.hero::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    z-index: -1;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-gray);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

/* --- Auth Pages --- */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    padding: 2.5rem;
    width: 100%;
    max-width: 450px;
    backdrop-filter: blur(20px);
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: white;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* --- Dashboard --- */

.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    position: fixed;
    height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
}

.nav-item {
    padding: 1rem;
    border-radius: 0.75rem;
    color: var(--text-gray);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
}

/* Dashboard Result Cards */
.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: 2rem;
    margin-top: 2rem;
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
}

.result-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
}

.process-number {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.5rem;
}

.movement-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-white);
}

.movement-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.movement-date {
    display: inline-flex;
    align-items: center;
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 700;
    width: fit-content;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.movement-text {
    line-height: 1.6;
    color: var(--text-white);
    font-size: 1.1rem;
}

/* Badge for Source */
.source-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 0.2rem 0.6rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-gray);
    margin-left: 0.5rem;
}

/* Loading Spinner */
.loading {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 4rem 0;
}

.spinner,
.spin {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(99, 102, 241, 0.1);
    border-left-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Top Quick Search in Dashboard */
.top-search-bar {
    max-width: 800px;
    margin-bottom: 2rem;
}

.search-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 0.5rem;
    display: flex;
    gap: 0.5rem;
    backdrop-filter: blur(16px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-container:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.search-container input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-white);
    padding: 0.75rem 1.25rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.search-container input::placeholder {
    color: var(--text-muted);
}

/* --- Animations --- */

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.animate-up {
    animation: slideInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Filter Chips */
.chip {
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-gray);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
}

.chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* WhatsApp Settings Styles */
.wa-number-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    transition: all 0.2s;
}

.wa-number-item:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.05);
}

/* Custom Toggle Switch */
.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: .4s;
    border-radius: 24px;
    border: 1px solid var(--border);
}

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

input:checked+.slider {
    background-color: #25d366;
    border-color: #25d366;
}

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

.remove-wa-btn {
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.remove-wa-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}