/* ═══════════════════════════════════════════════════════════
 *  theme-additions.css — Phase 0 Additions
 *
 *  Ye content existing assets/css/theme.css ke END me
 *  APPEND karna hai. Ye overwrite nahi karta, sirf naye
 *  skeleton + shared utility classes add karta hai.
 * ═══════════════════════════════════════════════════════════ */

/* ═══ SKELETON LOADER ═══ */

@keyframes skel-shimmer {
    0%   { background-position: -1000px 0; }
    100% { background-position:  1000px 0; }
}

.skel-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px;
    animation: skel-fade-in .3s ease-out;
}

@keyframes skel-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Base shimmer element */
.skel-line,
.skel-card,
.skel-avatar,
.skel-circle,
.skel-badge,
.skel-image,
.skel-input,
.skel-hero,
.skel-bubble {
    background: linear-gradient(
        90deg,
        var(--bg3) 0%,
        var(--bdr) 50%,
        var(--bg3) 100%
    );
    background-size: 1000px 100%;
    animation: skel-shimmer 1.8s infinite linear;
    border-radius: var(--radius-sm, 10px);
}

.skel-line {
    height: 12px;
    width: 100%;
    border-radius: 6px;
}
.skel-line-lg { height: 18px; width: 70%; }
.skel-line-md { height: 12px; width: 85%; }
.skel-line-sm { height: 10px; width: 45%; }

.skel-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-radius: var(--radius, 14px);
    background: var(--bg2);
    border: 1px solid var(--bdr);
    /* Shimmer is on children, not the card itself */
    animation: none;
}
.skel-card .skel-line {
    animation: skel-shimmer 1.8s infinite linear;
}

.skel-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: var(--radius, 14px);
    background: var(--bg2);
    border: 1px solid var(--bdr);
}
.skel-row-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skel-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skel-circle {
    width: 42px;
    height: 42px;
    border-radius: 13px;
}

.skel-badge {
    width: 60px;
    height: 24px;
    border-radius: 12px;
    flex-shrink: 0;
}

.skel-image {
    width: 100%;
    height: 140px;
    border-radius: var(--radius, 14px);
}

.skel-hero {
    width: 100%;
    height: 200px;
    border-radius: var(--radius-lg, 22px);
    margin-bottom: 20px;
}

.skel-input {
    height: 42px;
    width: 100%;
    border-radius: var(--radius-sm, 10px);
}
.skel-btn {
    height: 44px;
    width: 140px;
    margin-top: 8px;
}
.skel-label {
    width: 90px;
    margin-bottom: 6px;
}

/* Stats grid */
.skel-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.skel-stat {
    padding: 22px;
    border-radius: var(--radius, 14px);
    background: var(--bg2);
    border: 1px solid var(--bdr);
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 140px;
}

/* Grid (cards in a grid) */
.skel-grid {
    display: grid;
    grid-template-columns: repeat(var(--skel-cols, 3), 1fr);
    gap: 16px;
}
@media (max-width: 900px) {
    .skel-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .skel-grid { grid-template-columns: 1fr; }
}

/* Form */
.skel-form {
    max-width: 560px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px;
}
.skel-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Table */
.skel-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: var(--radius, 14px);
    background: var(--bg2);
    border: 1px solid var(--bdr);
}
.skel-table-head,
.skel-table-row {
    display: grid;
    grid-template-columns: repeat(var(--skel-cols, 5), 1fr);
    gap: 16px;
    padding: 10px 14px;
    align-items: center;
}
.skel-table-head {
    border-bottom: 1px solid var(--bdr);
    opacity: 0.7;
}
.skel-table-row:not(:last-child) {
    border-bottom: 1px dashed var(--bdr);
}

/* Chat bubbles */
.skel-chat {
    display: flex;
    padding: 8px 16px;
}
.skel-chat-left  { justify-content: flex-start; }
.skel-chat-right { justify-content: flex-end; }
.skel-bubble {
    max-width: 60%;
    padding: 14px 18px;
    border-radius: var(--radius-lg, 22px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg2);
    border: 1px solid var(--bdr);
    min-width: 200px;
    animation: none;
}
.skel-bubble .skel-line {
    animation: skel-shimmer 1.8s infinite linear;
}

/* Detail page */
.skel-detail {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px;
    max-width: 900px;
}


/* ═══ EMPTY STATE (universal) ═══ */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    max-width: 440px;
    margin: 0 auto;
}
.empty-state svg {
    width: 56px;
    height: 56px;
    color: var(--t3);
    margin-bottom: 16px;
    opacity: 0.6;
}
.empty-state h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--t1);
    margin-bottom: 6px;
}
.empty-state p {
    font-size: 0.9rem;
    color: var(--t2);
    margin-bottom: 18px;
    line-height: 1.5;
}


/* ═══ ERROR STATE ═══ */
.error-state {
    text-align: center;
    padding: 40px 24px;
    max-width: 440px;
    margin: 0 auto;
    border-radius: var(--radius, 14px);
    border: 1px solid var(--dns);
    background: var(--dns);
}
.error-state svg {
    width: 44px;
    height: 44px;
    color: var(--dng);
    margin-bottom: 12px;
}
.error-state h3 {
    color: var(--dng);
    font-size: 1.05rem;
    margin-bottom: 6px;
}
.error-state p {
    font-size: 0.88rem;
    color: var(--t2);
    margin-bottom: 14px;
}


/* ═══ TOAST (already referenced by footer.php) ═══ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 400px;
}
.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--bdr-h);
    border-radius: var(--radius, 14px);
    box-shadow: var(--shl);
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: all .4s cubic-bezier(.34, 1.56, .64, 1);
    min-width: 280px;
}
.toast.show {
    transform: translateX(0);
    opacity: 1;
}
.toast-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
}
.toast-icon svg {
    width: 100%;
    height: 100%;
}
.toast-msg {
    flex: 1;
    font-size: 0.88rem;
    color: var(--t1);
    line-height: 1.4;
}
.toast-close {
    background: none;
    border: none;
    color: var(--t3);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 22px;
    height: 22px;
}
.toast-success .toast-icon { color: var(--ac); }
.toast-error   .toast-icon { color: var(--dng); }
.toast-warning .toast-icon { color: var(--wrn); }
.toast-info    .toast-icon { color: var(--inf); }


/* ═══ COMMON BUTTON / INPUT CLASSES ═══ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border: 1px solid var(--bdr);
    border-radius: var(--radius-sm, 10px);
    background: var(--bg2);
    color: var(--t1);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--fast);
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover {
    background: var(--glass-h);
    border-color: var(--bdr-h);
    transform: translateY(-1px);
    box-shadow: var(--shm);
}
.btn-primary {
    background: var(--gac);
    color: #fff;
    border-color: transparent;
}
.btn-primary:hover {
    /* .btn:hover sets a near-white background and outranks .btn-primary,
       which left primary buttons white with white text on hover. */
    background: var(--gac);
    color: #fff;
    box-shadow: var(--shg);
}
.btn-danger {
    background: var(--dng);
    color: #fff;
    border-color: transparent;
}
.btn-danger:hover {
    background: var(--dng);
    color: #fff;
}
.btn-ghost {
    background: transparent;
}
.btn-ghost:hover {
    background: var(--glass-h);
}
.btn-sm {
    padding: 7px 14px;
    font-size: 0.82rem;
}
.btn-lg {
    padding: 14px 26px;
    font-size: 0.96rem;
}
.btn[disabled], .btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}
.form-field label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--t2);
}
.form-field input,
.form-field textarea,
.form-field select {
    padding: 11px 14px;
    border: 1px solid var(--bdr);
    border-radius: var(--radius-sm, 10px);
    background: var(--bg2);
    color: var(--t1);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: all var(--fast);
    outline: none;
    width: 100%;
}

/* Checkboxes and radios are not text fields: the rule above stretched them
   to the field width, which pushed their labels to the far right. */
.form-field input[type="checkbox"],
.form-field input[type="radio"],
.checkbox-grid input[type="checkbox"],
.checkbox-grid input[type="radio"] {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    padding: 0;
    margin: 0;
    accent-color: var(--ac);
}
.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    border-color: var(--ac);
    box-shadow: 0 0 0 3px var(--acs);
}
.form-field textarea {
    min-height: 96px;
    resize: vertical;
    font-family: var(--font);
}
.form-field .hint {
    font-size: 0.76rem;
    color: var(--t3);
    margin-top: 2px;
}

/* Section hero */
.section-hero {
    padding: 28px 34px;
    border-radius: 0 0 28px 28px;
    background: var(--bg3);
    margin-bottom: 24px;
}
.section-hero h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--t1);
}
.section-hero h1 span {
    background: var(--ghr);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.section-hero p {
    font-size: 0.92rem;
    color: var(--t2);
    margin-top: 6px;
}

/* ═══════════════════════════════════════════════════════════
 *  NOTIFICATION DROPDOWN (appended)
 * ═══════════════════════════════════════════════════════════ */
.notif-dropdown {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 360px;
    max-height: 520px;
    background: var(--bg2);
    border: 1px solid var(--bdr);
    border-radius: var(--radius-lg, 14px);
    box-shadow: var(--shl, 0 20px 60px rgba(0,0,0,.2));
    z-index: 9500;
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.notif-dropdown.show {
    display: flex;
    animation: notifSlide .18s ease-out;
}
@keyframes notifSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--bdr);
    flex-shrink: 0;
}
.notif-title {
    font-weight: 600;
    font-size: 0.96rem;
    color: var(--t1);
}
.notif-mark-all {
    font-size: 0.74rem;
    color: var(--ac);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background .15s;
    font-family: inherit;
}
.notif-mark-all:hover {
    background: var(--acs);
}

.notif-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
    max-height: 400px;
}
.notif-list::-webkit-scrollbar {
    width: 6px;
}
.notif-list::-webkit-scrollbar-thumb {
    background: var(--bdr);
    border-radius: 3px;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 18px;
    cursor: pointer;
    transition: background .15s;
    border-left: 3px solid transparent;
}
.notif-item:hover {
    background: var(--bg3);
}
.notif-item.unread {
    background: var(--acs);
    border-left-color: var(--ac);
}
.notif-item.unread:hover {
    background: var(--acs);
    filter: brightness(0.98);
}

.notif-item-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
    background: var(--inf);
}
.notif-item-dot.success { background: var(--ac); }
.notif-item-dot.warning { background: var(--wrn); }
.notif-item-dot.error, .notif-item-dot.danger { background: var(--dng); }
.notif-item-dot.info { background: var(--inf); }

.notif-item-body {
    flex: 1;
    min-width: 0;
}
.notif-item-title {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--t1);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-item-msg {
    font-size: 0.78rem;
    color: var(--t2);
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notif-item-time {
    font-size: 0.7rem;
    color: var(--t3);
}

.notif-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--t3);
    font-size: 0.86rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.notif-foot {
    padding: 10px 18px;
    border-top: 1px solid var(--bdr);
    text-align: center;
    flex-shrink: 0;
}
.notif-foot-link {
    font-size: 0.82rem;
    color: var(--ac);
    font-weight: 500;
    text-decoration: none;
}
.notif-foot-link:hover {
    text-decoration: underline;
}

/* Pulse animation for new badges */
@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}
.nbdg, .bdg {
    animation: badgePulse 0.4s ease-out;
}

/* Mobile responsive dropdown */
@media (max-width: 600px) {
    .notif-dropdown {
        left: 10px;
        right: 10px;
        width: auto;
        max-height: 70vh;
    }
}
