/* =========================================
   Typelove Unified UI System (Synced)
========================================= */

:root {
    --primary: #9F7AEA;
    --primary-dark: #805AD5;
    --primary-soft: rgba(159,122,234,0.08);

    --border: rgba(159,122,234,0.15);
    --text: #1F1F29;
    --muted: #8B8B9C;

    --bg-soft: #F6F4FF;
    --bg-glass: rgba(255,255,255,0.65);

    --shadow-soft: 0 10px 30px rgba(159,122,234,0.08);
    --shadow-hover: 0 20px 50px rgba(159,122,234,0.15);
    --shadow-deep: 0 30px 70px rgba(159,122,234,0.12);

    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

/* =========================================
   Dashboard Wrapper
========================================= */

.typelove-dashboard {
    max-width: 920px;
    margin: 4rem auto;
    padding: 0 1.5rem;
    font-family: 'Inter', sans-serif;
    color: var(--text);
}

.td-header h2 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

/* =========================================
   Tabs
========================================= */

.td-tabs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.td-tab {
    padding: 0.65rem 1.3rem;
    border-radius: 40px;
    border: 1px solid var(--border);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);

    font-weight: 500;
    font-size: 0.85rem;
    color: var(--muted);

    cursor: pointer;
    transition: all 0.25s ease;
}

.td-tab:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
    transform: translateY(-2px);
}

.td-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 12px 25px rgba(159,122,234,0.35);
}

/* =========================================
   Panels
========================================= */

.td-panel {
    display: none;
}

.td-panel.active {
    display: block;
}

/* =========================================
   Row Card (Synced with Stack UI)
========================================= */

.td-row {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 1.3rem 1.6rem;
    border-radius: var(--radius-md);

    border: 1px solid var(--border);
    background: var(--bg-glass);
    backdrop-filter: blur(12px);

    margin-bottom: 1rem;

    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
}

.td-row:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.td-row strong {
    font-weight: 600;
    font-size: 0.95rem;
}

.td-meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.2rem;
}

/* =========================================
   Actions
========================================= */

.td-actions a {
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 600;
    color: var(--primary-dark);
    margin-left: 1rem;
    transition: 0.2s;
}

.td-actions a:hover {
    opacity: 0.7;
}

/* =========================================
   Edit Wrapper
========================================= */

.typelove-edit-wrapper {
    max-width: 760px;
    margin: 3rem auto;
    padding: 0 1rem;
}

/* =========================================
   Submit Form Card (Glass Version)
========================================= */

.typelove-submit-form {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);

    padding: 3rem;
    border-radius: var(--radius-lg);

    border: 1px solid var(--border);
    box-shadow: var(--shadow-deep);

    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

/* =========================================
   Labels
========================================= */

.typelove-submit-form label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted);
}

/* =========================================
   Inputs
========================================= */

.typelove-submit-form input[type="text"],
.typelove-submit-form input[type="url"],
.typelove-submit-form select {
    padding: 1rem 1.2rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    transition: all 0.25s ease;
}

.typelove-submit-form input:focus,
.typelove-submit-form select:focus {
    outline: none;
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

/* =========================================
   File Upload
========================================= */

.typelove-submit-form input[type="file"] {
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1.5px dashed var(--border);
    background: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    transition: 0.25s ease;
}

.typelove-submit-form input[type="file"]:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

/* =========================================
   Button
========================================= */

#typelove-update-btn {
    margin-top: 2rem;
    padding: 1rem 2.5rem;
    border-radius: 40px;
    border: none;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.4px;
    color: #fff;

    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    cursor: pointer;

    transition: all 0.3s ease;
    align-self: flex-start;
}

#typelove-update-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(159,122,234,0.35);
}

/* =========================================
   Spinner
========================================= */

.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin .6s linear infinite;
    margin-left: 8px;
}

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

/* =========================================
   Toast
========================================= */

#typelove-toast {
    position: fixed;
    bottom: 40px;
    right: 40px;

    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    backdrop-filter: blur(14px);

    border: 1px solid rgba(255,255,255,0.2);

    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 18px;

    opacity: 0;
    transform: translateY(20px);
    transition: 0.4s ease;

    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    font-size: 0.85rem;
}

#typelove-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    background: #E53E3E;
}

/* =========================================
   Image Preview
========================================= */

.typelove-image-preview img {
    width: 100%;
    max-width: 240px;
    border-radius: var(--radius-md);
    box-shadow: 0 15px 30px rgba(0,0,0,0.06);
    transition: 0.3s;
}

.typelove-image-preview img:hover {
    transform: scale(1.03);
}

/* =========================================
   File Preview Box
========================================= */

.typelove-file-preview {
    background: var(--primary-soft);
    padding: 1.2rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.typelove-file-preview a {
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.typelove-file-preview a:hover {
    opacity: 0.7;
}

/* =========================================
   Responsive
========================================= */

@media (max-width: 768px) {
    .typelove-dashboard {
        margin: 2rem auto;
    }

    .typelove-submit-form {
        padding: 2rem;
    }

    #typelove-update-btn {
        width: 100%;
        align-self: stretch;
    }
}