/* ===== Alpha - Modern Dashboard Styles ===== */

:root {
    --blue: #2563EB;
    --blue-dark: #1E40AF;
    --dark: #0B1220;
    --bg: #F6F8FC;
    --card: #FFFFFF;
    --text: #0F172A;
    --muted: #64748B;
    --border: #E5E7EB;
    --success: #16A34A;
    --danger: #DC2626;
    --warning: #F59E0B;
}

/* ===== Dark Mode ===== */
body.dark {
    --bg: #020617;
    --card: #0F172A;
    --text: #E5E7EB;
    --muted: #94A3B8;
    --border: #1E293B;
    --dark: #000000;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Inter, sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    transition: background 0.2s, color 0.2s;
    overflow: hidden;
}

/* ===== App Container ===== */
.app {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 16px;
}

/* ===== Top Navbar ===== */
.navbar {
    height: 64px;
    background: #020617;
    border-radius: 18px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.brand {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    color: #CBD5E1;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-link i {
    font-size: 18px;
}

.nav-link:hover {
    background: rgba(37, 99, 235, 0.15);
    color: #fff;
}

.nav-link.active {
    background: rgba(37, 99, 235, 0.22);
    color: #fff;
}

/* ===== Theme Toggle ===== */
.theme-toggle {
    margin-left: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #fff;
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* ===== Content Grid ===== */
.content {
    flex: 1;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 20px;
    overflow-y: auto;
    padding-bottom: 10px;
}

/* ===== Cards ===== */
.card {
    background: var(--card);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

/* ===== Card Header ===== */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.card-header div {
    display: flex;
    gap: 8px;
}

/* ===== Buttons ===== */
.btn {
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn i {
    font-size: 16px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-primary {
    background: var(--blue);
    color: #fff;
    width: 100%;
    padding: 14px;
    font-size: 15px;
}

.btn-primary:disabled {
    background: var(--muted);
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

/* ===== Table ===== */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
    /* Reduced from 10px */
    font-size: 13px;
}

.table thead tr {
    border-spacing: 0;
}

.table th {
    text-align: left;
    color: var(--muted);
    font-weight: 600;
    padding: 0 10px 6px 10px;
    /* Reduced padding */
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tbody tr {
    transition: transform 0.1s ease;
}

.table tbody tr:hover {
    transform: translateX(2px);
}

.table td {
    background: rgba(148, 163, 184, 0.08);
    padding: 6px 10px;
    /* Reduced to super compact */
    color: var(--text);
}

body.dark .table td {
    background: rgba(148, 163, 184, 0.05);
}

.table tr td:first-child {
    border-radius: 10px 0 0 10px;
}

.table tr td:last-child {
    border-radius: 0 10px 10px 0;
}

/* Table Actions */
.action {
    display: flex;
    gap: 12px;
    font-size: 18px;
}

.action i {
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 4px;
    border-radius: 6px;
}

.action i:hover {
    transform: scale(1.15);
}

.reload {
    color: var(--success);
}

.reload:hover {
    background: rgba(22, 163, 74, 0.1);
}

.delete {
    color: var(--danger);
}

.delete:hover {
    background: rgba(220, 38, 38, 0.1);
}

/* ===== Form Elements ===== */
label {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    display: block;
    margin-bottom: 6px;
}

input,
textarea {
    width: 100%;
    margin-top: 6px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    transition: all 0.2s ease;
}

/* Custom Select Dropdown */
select {
    width: 100%;
    margin-top: 6px;
    padding: 12px 14px;
    padding-right: 40px;
    /* Space for custom arrow */
    border-radius: 12px;
    border: 1px solid var(--border);
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    transition: all 0.2s ease;
    cursor: pointer;
    appearance: none;
    /* Remove default arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
}

body.dark select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

select:hover {
    border-color: var(--blue);
    background-color: var(--card);
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    background-color: var(--card);
}

textarea {
    resize: vertical;
    flex: 1;
    min-height: 120px;
}

/* ===== Spam Score ===== */
.spam-score {
    margin: 16px 0;
    padding: 16px;
    background: rgba(22, 163, 74, 0.08);
    border: 1px solid rgba(22, 163, 74, 0.2);
    border-radius: 12px;
}

.score-display {
    font-size: 16px;
    font-weight: 600;
    color: var(--success);
    margin-bottom: 8px;
}

.score-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.score-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.3s ease;
}

.score-hint {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}

.score-hint strong {
    color: var(--success);
    font-weight: 600;
}

/* ===== Limit Info ===== */
.limit-info {
    margin: 14px 0;
    padding: 12px;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 12px;
    font-size: 13px;
    color: var(--blue);
    font-weight: 500;
}

/* ===== Status Message ===== */
.status-message {
    margin: 14px 0;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    display: none;
}

.status-message.status-info {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.2);
    color: var(--blue);
    display: block;
}

.status-message.status-success {
    background: rgba(22, 163, 74, 0.1);
    border: 1px solid rgba(22, 163, 74, 0.2);
    color: var(--success);
    display: block;
}

.status-message.status-error {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.2);
    color: var(--danger);
    display: block;
}

/* ===== Send Button Container ===== */
.send {
    margin-top: auto;
}

/* ===== Loader ===== */
.loader {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* ===== Responsive - Keep 3 Columns Always ===== */
@media (max-width: 1400px) {
    .app {
        overflow-x: auto;
    }

    .content {
        min-width: 1100px;
    }
}

@media (max-width: 768px) {
    .app {
        padding: 12px;
        gap: 12px;
        overflow-x: auto;
    }

    .navbar {
        min-width: 1100px;
        padding: 12px 16px;
    }

    .brand {
        font-size: 18px;
    }

    .nav-link {
        font-size: 13px;
        padding: 8px 12px;
    }

    .content {
        min-width: 1100px;
        grid-template-columns: 1.4fr 1fr 1fr;
    }
}

/* ===== Spam Score Predictor (Matching Image Design) ===== */
.spam-score-card {
    margin: 16px 0 20px 0;
    padding: 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.spam-score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.spam-score-header label {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
}

.spam-score-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--success);
}

.spam-safe {
    color: var(--success);
    font-weight: 600;
}

.spam-bar {
    height: 8px;
    background: rgba(229, 231, 235, 0.5);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.spam-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.spam-hint {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
}

.safe-text {
    color: var(--success);
    font-weight: 600;
}

/* ===== Custom Alert Modal ===== */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.custom-alert-overlay.active {
    display: flex;
}

.custom-alert-dialog {
    background: var(--card);
    border-radius: 16px;
    padding: 24px;
    max-width: 400px;
    width: calc(100% - 40px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.custom-alert-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
}

.custom-alert-icon.info {
    background: rgba(37, 99, 235, 0.15);
    color: var(--blue);
}

.custom-alert-icon.success {
    background: rgba(22, 163, 74, 0.15);
    color: var(--success);
}

.custom-alert-icon.error {
    background: rgba(220, 38, 38, 0.15);
    color: var(--danger);
}

.custom-alert-icon.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.custom-alert-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    margin-bottom: 8px;
}

.custom-alert-message {
    font-size: 14px;
    color: var(--muted);
    text-align: center;
    line-height: 1.6;
    margin-bottom: 20px;
}

.custom-alert-actions {
    display: flex;
    gap: 10px;
}

.custom-alert-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-alert-btn-primary {
    background: var(--blue);
    color: white;
}

.custom-alert-btn-primary:hover {
    background: var(--blue-dark);
    transform: translateY(-1px);
}

.custom-alert-btn-secondary {
    background: var(--border);
    color: var(--text);
}

.custom-alert-btn-secondary:hover {
    background: var(--muted);
    color: white;
    transform: translateY(-1px);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .custom-alert-dialog {
        max-width: 90%;
        padding: 20px;
    }

    .custom-alert-title {
        font-size: 16px;
    }

    .custom-alert-message {
        font-size: 13px;
    }

    select {
        font-size: 13px;
        padding: 10px 12px;
        padding-right: 36px;
        background-size: 16px;
    }
}