/* KIIT Referral System – Global Styles */

/* ── Base ───────────────────────────────────────────────────────────────────── */
body {
    background: #f4f7fc;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
}

/* ── Cards ───────────────────────────────────────────────────────────────────── */
.card {
    border-radius: 16px;
    border: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* ── Navbar ──────────────────────────────────────────────────────────────────── */
.navbar {
    border-radius: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
    border-radius: 50px;
    padding: 0.45rem 1.4rem;
    font-weight: 500;
    transition: transform 0.15s, box-shadow 0.15s;
}
.btn:active { transform: scale(0.97); }

/* ── Tables ──────────────────────────────────────────────────────────────────── */
.table th {
    background-color: #e9ecef;
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.table td { vertical-align: middle; }

/* ── Form Controls ───────────────────────────────────────────────────────────── */
.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102,126,234,0.15);
}

/* ── Badges ──────────────────────────────────────────────────────────────────── */
.badge {
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
    padding: 0.35em 0.7em;
}

/* ── Toast Notifications ─────────────────────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}
.toast-msg {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.2rem;
    border-radius: 12px;
    color: #fff;
    min-width: 260px;
    max-width: 380px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.18);
    animation: toastSlideIn 0.3s ease;
    pointer-events: all;
    font-size: 0.9rem;
}
.toast-success { background: #198754; }
.toast-danger  { background: #dc3545; }
.toast-warning { background: #e67e22; color: #fff; }
.toast-info    { background: #0d6efd; }
.toast-icon    { font-size: 1.1rem; flex-shrink: 0; }
.toast-body    { flex: 1; }
.toast-close   { cursor: pointer; font-size: 1.2rem; opacity: 0.75; line-height: 1; flex-shrink: 0; }
.toast-close:hover { opacity: 1; }

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(60px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastFadeOut {
    to { opacity: 0; transform: translateX(60px); }
}

/* ── Skeleton Loader ─────────────────────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
    border-radius: 4px;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Monospace Code ──────────────────────────────────────────────────────────── */
.font-monospace, code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.88em;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
}

/* ── Responsive Tweaks ───────────────────────────────────────────────────────── */
@media (max-width: 576px) {
    .card { border-radius: 12px; }
    .btn { padding: 0.4rem 1rem; font-size: 0.9rem; }
    h4 { font-size: 1.1rem; }
    .fs-2 { font-size: 1.5rem !important; }
}

/* ── Input Group Fix ─────────────────────────────────────────────────────────── */
/* Prevent gap between rounded pill inputs and their icon addons */
.input-group > .input-group-text {
    border-color: #dee2e6;
    transition: border-color 0.15s;
}
.input-group:focus-within > .input-group-text {
    border-color: #667eea;
}

/* ── Navbar Active Link ───────────────────────────────────────────────────────── */
.navbar-dark .navbar-nav .nav-link.active {
    color: #fff !important;
    border-bottom: 2px solid rgba(255,255,255,0.7);
    padding-bottom: calc(0.5rem - 2px);
}

/* ── Admin Active Nav Link ───────────────────────────────────────────────────── */
.navbar-dark .navbar-nav .nav-link.fw-semibold {
    color: #fff !important;
}

/* ── Page transition fade ────────────────────────────────────────────────────── */
body {
    animation: pageFadeIn 0.2s ease;
}
@keyframes pageFadeIn {
    from { opacity: 0.7; }
    to   { opacity: 1; }
}

/* ── Payout card highlight ───────────────────────────────────────────────────── */
.payout-section {
    border-left: 4px solid #198754;
}

/* ── Referral link box ───────────────────────────────────────────────────────── */
#refLink {
    font-size: 0.82rem;
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    color: #495057;
}
