:root {
    --primary: #25D366;
    /* WhatsApp Green */
    --primary-dark: #128C7E;
    --accent: #34B7F1;
    --bg-dark: #0f1115;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --input-bg: rgba(0, 0, 0, 0.2);
    --font-family: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Animation */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: move 20s infinite alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: var(--primary);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: var(--accent);
    animation-delay: -5s;
}

@keyframes move {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(50px, 50px);
    }
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 480px;
    /* Mobile width constraint */
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

header {
    text-align: center;
    margin-bottom: 12px;
}

header h1 {
    font-weight: 700;
    font-size: 2rem;
    background: linear-gradient(to right, #fff, #aaa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Cards (Glassmorphism) */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.section-label {
    display: block;
    margin-bottom: 12px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Sender Toggle */
.sender-toggle {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.sender-toggle input {
    display: none;
}

.sender-option {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.sender-option .icon {
    font-size: 1.5rem;
}

.sender-toggle input:checked+.sender-option {
    background: rgba(37, 211, 102, 0.15);
    /* Tint of primary */
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 15px rgba(37, 211, 102, 0.2);
}

/* Inputs & Select */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-main);
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

input,
select {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--input-bg);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

input:focus,
select:focus {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.4);
}

/* Template Preview Box */
.preview-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    font-size: 0.9rem;
    color: var(--text-muted);
    min-height: 60px;
    white-space: pre-wrap;
    /* Preserve line breaks */
    line-height: 1.5;
}

/* Button */
.btn-primary {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}

.btn-primary:active {
    transform: scale(0.98);
}

.text-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.85rem;
    margin-top: 8px;
    display: block;
    width: 100%;
    text-align: right;
}

/* Logs */
.logs {
    margin-top: 20px;
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    word-break: break-all;
}

.log-item {
    padding: 8px;
    border-bottom: 1px solid var(--glass-border);
}

.log-success {
    color: var(--primary);
}

.log-error {
    color: #ff5555;
}

/* Animations */
.bounce-in {
    animation: bounceIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fade-in-up {
    opacity: 0;
    animation: fadeInUp 0.8s forwards cubic-bezier(0.2, 0.8, 0.2, 1);
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Login Styles */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: #1a1d24;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.blur-content {
    transition: filter 0.5s ease;
    filter: blur(10px);
    pointer-events: none;
    user-select: none;
}

.blur-content.active {
    filter: blur(0);
    pointer-events: all;
    user-select: auto;
}

/* Logs Container */
.logs-container {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Log Card */
.log-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.log-card:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: translateX(4px);
}

.log-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.log-body {
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.log-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

/* Status Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-neutral {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

.badge-success {
    background: rgba(37, 211, 102, 0.15);
    color: var(--primary);
}

.badge-info {
    background: rgba(52, 183, 241, 0.15);
    color: var(--accent);
}

.badge-error {
    background: rgba(255, 85, 85, 0.15);
    color: #ff5555;
}

/* Status specific borders */
.status-delivered {
    border-left-color: var(--accent);
}

.status-read {
    border-left-color: var(--primary);
}

.status-failed {
    border-left-color: #ff5555;
}