:root {
    --bg-dark: #0f1115;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #ffffff;
    --text-muted: #8b949e;
    --wa-green: #25D366;
    --wa-green-hover: #1EBE5D;
    --danger: #ff4a4a;
    --danger-hover: #e03131;
    --input-bg: rgba(0, 0, 0, 0.2);
    --focus-ring: rgba(37, 211, 102, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(37, 211, 102, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(93, 108, 208, 0.15), transparent 25%);
}

/* Abstract blurred blobs for background */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.5;
    animation: float 10s ease-in-out infinite alternate;
}

.blob-1 {
    width: 300px;
    height: 300px;
    background: #25D366;
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: #202c33;
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 50px) scale(1.1); }
}

.container {
    width: 100%;
    max-width: 420px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fade-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.header {
    text-align: center;
    margin-bottom: 35px;
}

.icon {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    filter: drop-shadow(0 8px 16px rgba(37, 211, 102, 0.3));
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

p.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    transition: all 0.2s ease;
    position: relative;
}

.input-wrapper:focus-within {
    border-color: var(--wa-green);
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.country-code-selector {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    padding: 14px 12px 14px 16px;
    border-right: 1px solid var(--glass-border);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    font-weight: 500;
}

/* Basic custom dropdown arrow for select */
.select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.select-wrapper::after {
    content: "▼";
    font-size: 0.6rem;
    color: var(--text-muted);
    position: absolute;
    right: 12px;
    pointer-events: none;
}

.country-code-selector option {
    background: var(--bg-dark);
    color: var(--text-main);
}

input[type="tel"] {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1.1rem;
    padding: 14px 16px;
    outline: none;
    width: 100%;
}

input[type="tel"]::placeholder {
    color: rgba(255,255,255,0.2);
}

.actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

button {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 14px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

button:active {
    transform: scale(0.98);
}

.btn-primary {
    flex: 2;
    background: var(--wa-green);
    color: #000;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-primary:hover {
    background: var(--wa-green-hover);
}

.btn-secondary {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-primary svg {
    width: 20px;
    height: 20px;
}

/* Recent History Section */
.recent-section {
    margin-top: 35px;
    border-top: 1px solid var(--glass-border);
    padding-top: 25px;
    display: none; /* hidden if empty */
}

.recent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.recent-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.clear-history {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 4px 8px;
    cursor: pointer;
    box-shadow: none;
}

.clear-history:hover {
    color: var(--danger);
}

.recent-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.recent-number {
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.recent-number::before {
    content: "🕒";
    font-size: 0.8rem;
    opacity: 0.5;
}

.recent-action {
    color: var(--wa-green);
}
