/* =========================================================
   PRO TAMIL BIBLE — COMPONENTS
   Reusable UI Components
   ========================================================= */


/* =========================================================
   1. BUTTON BASE
   ========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    min-height: 38px;
    padding: 0 13px;

    border: 1px solid transparent;
    border-radius: 8px;

    font-size: 10px;
    font-weight: 750;

    white-space: nowrap;

    transition:
        background var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast),
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

.btn:active {
    transform: translateY(1px);
}


/* Primary */

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);

    box-shadow:
        0 6px 18px rgba(37, 99, 235, 0.25);
}


/* Secondary */

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--panel-hover);
    border-color: var(--border-light);
    color: var(--text-primary);
}


/* Success */

.btn-success {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.25);
    color: #6ee7a0;
}

.btn-success:hover {
    background: rgba(34, 197, 94, 0.20);
}


/* Danger */

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.20);
}


/* Warning */

.btn-warning {
    background: var(--accent-soft);
    border-color: rgba(245, 196, 81, 0.25);
    color: #f7d978;
}

.btn-warning:hover {
    background: rgba(245, 196, 81, 0.20);
}


/* Ghost */

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}


/* =========================================================
   2. ICON BUTTON
   ========================================================= */

.icon-btn {
    width: 36px;
    height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: rgba(255, 255, 255, 0.025);

    color: var(--text-secondary);

    transition:
        background var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast),
        transform var(--transition-fast);
}

.icon-btn:hover {
    background: var(--panel-hover);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.icon-btn:active {
    transform: scale(0.94);
}


/* =========================================================
   3. BADGES
   ========================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;

    min-height: 23px;
    padding: 3px 8px;

    border-radius: 999px;

    font-size: 8px;
    font-weight: 800;

    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.badge-blue {
    background: rgba(79, 140, 255, 0.12);
    color: var(--primary-light);
}

.badge-green {
    background: var(--success-soft);
    color: #6ee7a0;
}

.badge-red {
    background: var(--live-soft);
    color: #fca5a5;
}

.badge-gold {
    background: var(--accent-soft);
    color: #f7d978;
}

.badge-gray {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}


/* =========================================================
   4. LIVE STATUS
   ========================================================= */

.live-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 5px 8px;

    border-radius: 6px;

    background: var(--live-soft);

    color: #fca5a5;

    font-size: 8px;
    font-weight: 800;

    letter-spacing: 0.7px;
}

.live-status::before {
    content: "";

    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: var(--live);

    box-shadow:
        0 0 8px rgba(239, 68, 68, 0.65);
}


/* =========================================================
   5. CARD
   ========================================================= */

.card {
    background: var(--panel);

    border: 1px solid var(--border);

    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-sm);
}

.card-body {
    padding: 15px;
}


/* =========================================================
   6. CARD HEADER
   ========================================================= */

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 52px;

    padding: 10px 14px;

    border-bottom: 1px solid var(--border);
}

.card-heading {
    display: flex;
    align-items: center;
    gap: 9px;
}

.card-heading-icon {
    width: 31px;
    height: 31px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 8px;

    background: rgba(79, 140, 255, 0.09);

    font-size: 14px;
}

.card-heading h3 {
    font-size: 11px;
    font-weight: 750;
}

.card-heading p {
    margin-top: 2px;

    color: var(--text-muted);

    font-size: 8px;
}


/* =========================================================
   7. VERSE CARD
   ========================================================= */

.verse-card {
    position: relative;

    padding: 14px;

    border: 1px solid var(--border);

    border-radius: 10px;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.025),
            rgba(255, 255, 255, 0.008)
        );

    transition:
        border-color var(--transition-fast),
        background var(--transition-fast),
        transform var(--transition-fast);
}

.verse-card:hover {
    border-color: rgba(79, 140, 255, 0.22);

    background:
        linear-gradient(
            145deg,
            rgba(79, 140, 255, 0.045),
            rgba(255, 255, 255, 0.008)
        );

    transform: translateY(-1px);
}

.verse-card.selected {
    border-color: rgba(79, 140, 255, 0.45);

    box-shadow:
        0 0 0 2px rgba(79, 140, 255, 0.08);
}

.verse-card-reference {
    margin-bottom: 8px;

    color: var(--accent);

    font-size: 11px;
    font-weight: 800;
}

.verse-card-text {
    color: var(--text-secondary);

    font-family:
        "Noto Sans Tamil",
        "Segoe UI",
        sans-serif;

    font-size: 12px;
    line-height: 1.8;
}

.verse-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 8px;

    margin-top: 12px;
    padding-top: 9px;

    border-top: 1px solid var(--border);
}


/* =========================================================
   8. ACTION GROUP
   ========================================================= */

.action-group {
    display: flex;
    align-items: center;
    gap: 5px;

    flex-wrap: wrap;
}

.action-group-right {
    justify-content: flex-end;
}


/* =========================================================
   9. TOOLTIP
   ========================================================= */

[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);

    position: absolute;

    bottom: calc(100% + 7px);
    left: 50%;

    transform:
        translateX(-50%)
        translateY(3px);

    padding: 5px 8px;

    border: 1px solid var(--border-light);

    border-radius: 5px;

    background: #0b1220;

    color: var(--text-primary);

    font-size: 8px;
    font-weight: 600;

    white-space: nowrap;

    opacity: 0;
    pointer-events: none;

    transition:
        opacity var(--transition-fast),
        transform var(--transition-fast);

    z-index: 200;
}

[data-tooltip]:hover::after {
    opacity: 1;

    transform:
        translateX(-50%)
        translateY(0);
}


/* =========================================================
   10. DIVIDER
   ========================================================= */

.divider {
    width: 100%;
    height: 1px;

    background: var(--border);

    margin: 12px 0;
}

.divider-vertical {
    width: 1px;
    height: 24px;

    background: var(--border);
}


/* =========================================================
   11. INPUT GROUP
   ========================================================= */

.input-group {
    display: flex;
    align-items: center;

    width: 100%;

    border: 1px solid var(--border);

    border-radius: 8px;

    background: #0d1626;

    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast);
}

.input-group:focus-within {
    border-color: rgba(79, 140, 255, 0.50);

    box-shadow:
        0 0 0 3px rgba(79, 140, 255, 0.07);
}

.input-group-icon {
    width: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--text-muted);
}

.input-group input {
    flex: 1;

    height: 40px;

    border: none;
    outline: none;

    background: transparent;

    color: var(--text-primary);

    font-size: 11px;
}


/* =========================================================
   12. SPINNER
   ========================================================= */

.spinner {
    width: 18px;
    height: 18px;

    border: 2px solid rgba(255, 255, 255, 0.10);

    border-top-color: var(--primary);

    border-radius: 50%;

    animation: componentSpin 0.8s linear infinite;
}

@keyframes componentSpin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   13. PROGRESS
   ========================================================= */

.progress {
    width: 100%;
    height: 5px;

    overflow: hidden;

    border-radius: 999px;

    background: rgba(255, 255, 255, 0.06);
}

.progress-bar {
    height: 100%;

    width: 0;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            var(--primary-dark),
            var(--primary-light)
        );

    transition: width 0.3s ease;
}


/* =========================================================
   14. ALERT
   ========================================================= */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;

    padding: 10px 11px;

    border: 1px solid var(--border);

    border-radius: 8px;

    font-size: 10px;
}

.alert-info {
    background: rgba(79, 140, 255, 0.08);
    border-color: rgba(79, 140, 255, 0.20);
    color: #a9c7ff;
}

.alert-success {
    background: var(--success-soft);
    border-color: rgba(34, 197, 94, 0.20);
    color: #86efac;
}

.alert-warning {
    background: var(--warning-soft);
    border-color: rgba(245, 158, 11, 0.20);
    color: #fcd34d;
}

.alert-danger {
    background: var(--live-soft);
    border-color: rgba(239, 68, 68, 0.20);
    color: #fca5a5;
}


/* =========================================================
   15. SKELETON LOADING
   ========================================================= */

.skeleton {
    position: relative;

    overflow: hidden;

    background: rgba(255, 255, 255, 0.045);

    border-radius: 5px;
}

.skeleton::after {
    content: "";

    position: absolute;

    inset: 0;

    transform: translateX(-100%);

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.05),
            transparent
        );

    animation: skeletonMove 1.4s infinite;
}

@keyframes skeletonMove {
    100% {
        transform: translateX(100%);
    }
}


/* =========================================================
   16. MODAL CONTENT
   ========================================================= */

.modal-overlay {
    position: fixed;

    inset: 0;

    z-index: 5000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background:
        rgba(0, 0, 0, 0.72);

    backdrop-filter: blur(5px);
}

.modal-card {
    width: min(520px, 100%);

    border: 1px solid var(--border-light);

    border-radius: var(--radius-xl);

    background: #101827;

    box-shadow: var(--shadow-lg);

    overflow: hidden;
}

.modal-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 15px;

    border-bottom: 1px solid var(--border);
}

.modal-card-header h3 {
    font-size: 13px;
}

.modal-card-body {
    padding: 17px;
}

.modal-card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 7px;

    padding: 12px 15px;

    border-top: 1px solid var(--border);
}


/* =========================================================
   17. NOTIFICATION
   ========================================================= */

.notification {
    display: flex;
    align-items: flex-start;
    gap: 9px;

    min-width: 260px;
    max-width: 360px;

    padding: 11px 13px;

    border: 1px solid var(--border-light);

    border-radius: 9px;

    background:
        rgba(15, 23, 36, 0.97);

    box-shadow: var(--shadow-md);
}

.notification-icon {
    width: 25px;
    height: 25px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 7px;

    background: rgba(255, 255, 255, 0.05);

    flex-shrink: 0;
}

.notification-content strong {
    display: block;

    color: var(--text-primary);

    font-size: 10px;
}

.notification-content p {
    margin-top: 2px;

    color: var(--text-muted);

    font-size: 9px;
}


/* =========================================================
   18. PRINT
   ========================================================= */

@media print {

    .topbar,
    .sidebar,
    .right-panel,
    .statusbar {
        display: none !important;
    }

    .workspace {
        display: block;
    }

    .main-content {
        padding: 0;
    }

    .panel {
        border: none;
        box-shadow: none;
    }
}