:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #3b82f6;
    --bg-dark: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(15, 23, 42, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    --error: #ef4444;
    --success: #10b981;
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

.background {
    position: fixed;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at top right, #1e1b4b, #0f172a);
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.6;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: rgba(37, 99, 235, 0.15);
    top: -150px;
    left: -150px;
    animation: float 10s infinite alternate ease-in-out;
}

.shape-2 {
    width: 600px;
    height: 600px;
    background: rgba(56, 189, 248, 0.1);
    bottom: -200px;
    right: -150px;
    animation: float 15s infinite alternate-reverse ease-in-out;
}

.shape-3 {
    width: 400px;
    height: 400px;
    background: rgba(30, 64, 175, 0.15);
    top: 50%;
    left: 40%;
    transform: translate(-50%, -50%);
    animation: pulse 12s infinite alternate ease-in-out;
}

@keyframes float {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(60px) scale(1.15); }
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1) opacity(0.8); }
    100% { transform: translate(-50%, -50%) scale(1.2) opacity(0.4); }
}

.container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    z-index: 10;
}

.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(20px);
    opacity: 0;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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

.header h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.header p {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.6;
}

.input-group {
    margin-bottom: 24px;
    position: relative;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #e2e8f0;
    transition: color 0.3s;
}

.input-group input, .custom-select, textarea {
    width: 100%;
    padding: 16px 20px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    color: white;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.custom-select {
    appearance: none;
    padding-right: 40px;
    cursor: pointer;
}

.select-wrapper {
    position: relative;
    width: 100%;
}

.select-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: transform 0.3s ease;
}

.select-wrapper:focus-within .select-icon {
    transform: translateY(-50%) rotate(180deg);
    color: var(--primary-color);
}

.custom-select option {
    background-color: var(--bg-dark);
    color: white;
    padding: 10px;
}

.input-group input:focus, .custom-select:focus, textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), inset 0 2px 4px rgba(0,0,0,0.1);
    background: rgba(15, 23, 42, 0.7);
}

.input-group input::placeholder, textarea::placeholder {
    color: rgba(148, 163, 184, 0.6);
}

.input-group:focus-within label {
    color: #a5b4fc;
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.2), transparent);
    transform: skewX(-20deg);
    transition: all 0.6s ease;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.btn-primary:hover::before {
    left: 150%;
}

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

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    filter: grayscale(0.5);
}

.loader {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s cubic-bezier(0.5, 0.1, 0.4, 0.9) infinite;
}

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

.status-message {
    margin-top: 20px;
    padding: 14px;
    border-radius: 10px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: none;
}

.status-message.show {
    opacity: 1;
    transform: translateY(0);
    display: block;
}

.status-message.success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-message.error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0; left: 0; width: 100%;
    padding: 20px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.glass-effect-nav {
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    font-size: 26px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 35px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 8px;
}

.nav-links a:hover, .nav-links a.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* Dashboard */
.dashboard-container {
    width: 100%;
    max-width: 850px;
    padding: 120px 20px 60px;
    margin: 0 auto;
    z-index: 10;
    display: flex;
    justify-content: center;
}

.dashboard-panel {
    width: 100%;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: white;
    margin: 35px 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
}

.radio-group, .checkbox-group {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.radio-label, .checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.5);
    padding: 14px 24px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    justify-content: center;
    font-weight: 500;
}

.radio-label:hover, .checkbox-label:hover {
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.05);
}

.radio-label input, .checkbox-label input {
    margin-right: 12px;
    accent-color: var(--primary-color);
    width: 18px;
    height: 18px;
}

.radio-label:has(input:checked) {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.15);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
    color: white;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.variable-hints {
    font-size: 13px;
    color: #cbd5e1;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.var-badge {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 12px;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Upload Area */
.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.4s ease;
    background: rgba(15, 23, 42, 0.3);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(37,99,235,0.05), rgba(56,189,248,0.05));
    opacity: 0;
    transition: opacity 0.4s;
    z-index: 0;
}

.upload-area:hover::before, .upload-area.dragover::before {
    opacity: 1;
}

.upload-area > * {
    position: relative;
    z-index: 1;
}

.upload-area.dragover {
    border-color: var(--secondary-color);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 48px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    display: inline-block;
}

.upload-area h3 {
    font-size: 20px;
    margin-bottom: 8px;
    font-weight: 700;
}

.upload-area p {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.file-hint {
    font-size: 13px !important;
    margin-top: 20px;
    opacity: 0.7;
    background: rgba(255,255,255,0.05);
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(4px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Schedule Inputs Flex */
.schedule-inputs {
    background: rgba(15, 23, 42, 0.3);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sender-group label span {
    gap: 10px;
}

/* Input Dates Webkit fixes */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.6;
    cursor: pointer;
}

/* Fallback for browsers that don't support :has */
input[type="radio"]:checked+span,
input[type="checkbox"]:checked+span {
    color: white;
    font-weight: 600;
}

@media (max-width: 600px) {
    .glass-effect { padding: 30px 20px; }
    .radio-group { flex-direction: column; gap: 12px; }
    .navbar { padding: 15px 20px; }
    .nav-links a { margin-left: 15px; font-size: 14px; }
    .dashboard-container { padding-top: 90px; }
    .schedule-inputs { flex-direction: column; gap: 0 !important; }
}

/* Histórico de Disparos */
.history-item {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.history-item:hover {
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.05);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 15px;
}

.history-date {
    font-weight: 700;
    color: white;
}

.history-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-agora {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-agendado {
    background: rgba(56, 189, 248, 0.15);
    color: #7dd3fc;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.history-body {
    margin-bottom: 20px;
}

.history-message {
    font-size: 14px;
    color: #cbd5e1;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    white-space: pre-wrap;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.history-info {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #94a3b8;
    flex-wrap: wrap;
}

.history-info span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.history-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
    width: auto;
    display: inline-flex;
    margin-top: 0;
    align-items: center;
    gap: 8px;
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

@media (max-width: 600px) {
    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .history-info {
        flex-direction: column;
        gap: 10px;
    }
}