/* ══════════════════════════════════════════════════════════════
   bgt-MediTrend — Form Theme
   Colorful, modern styling for form pages
   ══════════════════════════════════════════════════════════════ */

/* ─── CSS Variables ───────────────────────────────────────────── */
:root {
    --mt-primary: #6366f1;
    --mt-primary-dark: #4f46e5;
    --mt-primary-light: #a5b4fc;
    --mt-success: #10b981;
    --mt-warning: #f59e0b;
    --mt-danger: #ef4444;
    --mt-info: #06b6d4;
    --mt-pink: #ec4899;
    --mt-purple: #8b5cf6;
    --mt-orange: #f97316;
    --mt-teal: #14b8a6;
    --mt-gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --mt-gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --mt-gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --mt-gradient-4: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --mt-gradient-5: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --mt-gradient-6: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

/* ─── Form List Cards ─────────────────────────────────────────── */
.form-card {
    border: none;
    border-radius: 16px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.form-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--mt-gradient-1);
}

.form-card:nth-child(6n+2)::before { background: var(--mt-gradient-2); }
.form-card:nth-child(6n+3)::before { background: var(--mt-gradient-3); }
.form-card:nth-child(6n+4)::before { background: var(--mt-gradient-4); }
.form-card:nth-child(6n+5)::before { background: var(--mt-gradient-5); }
.form-card:nth-child(6n+6)::before { background: var(--mt-gradient-6); }

.form-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.form-card .card-body {
    padding: 24px 22px 18px;
    flex: 1;
}

.form-card-title {
    font-weight: 700;
    font-size: 1.15rem;
    color: #1f2937;
    margin-bottom: 6px;
    line-height: 1.3;
}

.form-card-description {
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 14px;
}

.form-card-stats {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 14px;
}

.form-card-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
}

.form-card-stat i {
    color: var(--mt-primary);
    font-size: 1rem;
}

/* ─── Colorful Badges ─────────────────────────────────────────── */
.badge-published {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
    white-space: nowrap;
}

.badge-draft {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
    white-space: nowrap;
}

/* ─── Colorful Buttons ────────────────────────────────────────── */
.btn-gradient-primary {
    background: var(--mt-gradient-1);
    color: white;
    border: none;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 10px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-gradient-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.4);
    color: white;
}

.btn-gradient-success {
    background: var(--mt-gradient-4);
    color: white;
    border: none;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(67, 233, 123, 0.3);
}

.btn-gradient-success:hover {
    transform: translateY(-2px);
    color: white;
}

.btn-gradient-danger {
    background: var(--mt-gradient-2);
    color: white;
    border: none;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.3);
}

.btn-gradient-danger:hover {
    transform: translateY(-2px);
    color: white;
}

/* ─── Empty State ─────────────────────────────────────────────── */
.form-empty-state {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border: 2px dashed #a5b4fc;
    border-radius: 20px;
    padding: 60px 30px;
    text-align: center;
    animation: fadeInUp 0.5s ease-out;
}

.form-empty-state > i {
    font-size: 4rem;
    background: var(--mt-gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.form-empty-state h3 {
    font-weight: 700;
    color: #1f2937;
    font-size: 1.5rem;
}

.form-empty-state p {
    font-size: 1rem;
    margin-bottom: 1.25rem;
}

/* ─── Fill Form Page ──────────────────────────────────────────── */
.fill-form-hero {
    background: var(--mt-gradient-1);
    color: white;
    padding: 40px 24px;
    border-radius: 20px 20px 0 0;
    position: relative;
    overflow: hidden;
}

.fill-form-hero::after {
    content: "";
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.fill-form-hero h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.fill-form-hero p {
    opacity: 0.9;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

.fill-form-card {
    background: white;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.fill-form-body {
    padding: 32px 32px 24px;
}

.fill-form-field {
    margin-bottom: 24px;
    position: relative;
}

.fill-form-label {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95rem;
    margin-bottom: 8px;
    display: block;
}

.fill-form-label .required-star {
    color: var(--mt-danger);
    margin-left: 4px;
}

.fill-form-field input[type="text"],
.fill-form-field input[type="number"],
.fill-form-field input[type="date"],
.fill-form-field input[type="email"],
.fill-form-field select,
.fill-form-field textarea {
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 1rem;
    transition: all 0.2s;
    width: 100%;
}

.fill-form-field input:focus,
.fill-form-field select:focus,
.fill-form-field textarea:focus {
    border-color: var(--mt-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    outline: none;
}

.fill-form-field .form-check {
    padding: 12px 16px 12px 44px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.fill-form-field .form-check:hover {
    border-color: var(--mt-primary-light);
    background: #f9fafb;
}

.fill-form-field .form-check input {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    cursor: pointer;
}

.fill-form-field .form-check input:checked ~ label {
    color: var(--mt-primary);
    font-weight: 600;
}

.fill-form-field .form-check label {
    cursor: pointer;
    margin: 0;
}

.fill-form-submit {
    padding: 24px 32px;
    background: #f9fafb;
    border-top: 2px solid #f3f4f6;
}

.fill-form-submit .btn {
    padding: 14px 32px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 12px;
    width: 100%;
    background: var(--mt-gradient-1);
    color: white;
    border: none;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
    transition: all 0.2s;
}

.fill-form-submit .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.45);
    color: white;
}

/* ─── KPI Cards (Analytics) ──────────────────────────────────── */
.kpi-card {
    border-radius: 16px;
    padding: 20px;
    color: white;
    position: relative;
    overflow: hidden;
    border: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s;
}

.kpi-card:hover {
    transform: translateY(-3px);
}

.kpi-card-1 { background: var(--mt-gradient-1); }
.kpi-card-2 { background: var(--mt-gradient-2); }
.kpi-card-3 { background: var(--mt-gradient-3); }
.kpi-card-4 { background: var(--mt-gradient-4); }

.kpi-card::after {
    content: "";
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
}

.kpi-card .kpi-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.kpi-card .kpi-value {
    font-size: 2rem;
    font-weight: 800;
    margin-top: 6px;
    position: relative;
    z-index: 1;
    line-height: 1;
}

.kpi-card .kpi-icon {
    position: absolute;
    bottom: 16px;
    right: 16px;
    font-size: 2.5rem;
    opacity: 0.25;
    z-index: 0;
}

/* ─── Submissions Table ──────────────────────────────────────── */
.submissions-card {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    border: none;
    background: white;
}

.submissions-card table {
    margin: 0;
}

.submissions-card thead {
    background: var(--mt-gradient-1);
    color: white;
}

.submissions-card thead th {
    border: none;
    font-weight: 600;
    padding: 14px 16px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.submissions-card tbody tr {
    transition: background 0.15s;
}

.submissions-card tbody tr:hover {
    background: #f9fafb;
}

.submissions-card tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-color: #f3f4f6;
}

/* ─── Page Header ────────────────────────────────────────────── */
.page-header {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    border-left: 6px solid var(--mt-primary);
}

.page-header h1,
.page-header h2,
.page-header h3 {
    color: #1f2937;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-header p {
    color: #6b7280;
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* ─── Animations ─────────────────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-card {
    animation: fadeInUp 0.4s ease-out;
    animation-fill-mode: both;
}

.form-card:nth-child(1) { animation-delay: 0.05s; }
.form-card:nth-child(2) { animation-delay: 0.10s; }
.form-card:nth-child(3) { animation-delay: 0.15s; }
.form-card:nth-child(4) { animation-delay: 0.20s; }
.form-card:nth-child(5) { animation-delay: 0.25s; }
.form-card:nth-child(6) { animation-delay: 0.30s; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .fill-form-hero {
        padding: 28px 20px;
    }

    .fill-form-hero h1 {
        font-size: 1.4rem;
    }

    .fill-form-body {
        padding: 24px 20px 16px;
    }

    .fill-form-submit {
        padding: 20px;
    }

    .kpi-card .kpi-value {
        font-size: 1.5rem;
    }

    .page-header {
        padding: 18px;
    }

    .form-card .card-body {
        padding: 20px 18px 14px;
    }
}

/* ══════════════════════════════════════════════════════════════
   Mobile responsiveness — Forms
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* ─── Form List ──────────────────────────────────────────── */
    .form-card .card-body {
        padding: 20px 18px 16px;
    }

    .form-card-title {
        font-size: 1.05rem;
    }

    .form-card-stats {
        flex-wrap: wrap;
        gap: 12px;
    }

    .form-card .btn {
        font-size: 0.85rem;
        padding: 8px 12px;
        min-height: 38px;
    }

    .form-empty-state {
        padding: 40px 20px;
    }

    .form-empty-state > i {
        font-size: 3rem;
    }

    .form-empty-state h3 {
        font-size: 1.25rem;
    }

    /* ─── Fill Form ──────────────────────────────────────────── */
    .fill-form-hero {
        padding: 32px 20px 28px;
        border-radius: 16px 16px 0 0;
    }

    .fill-form-hero h1 {
        font-size: 1.35rem;
    }

    .fill-form-hero p {
        font-size: 0.9rem;
    }

    .fill-form-body {
        padding: 24px 20px 16px;
    }

    .fill-form-field {
        margin-bottom: 20px;
    }

    .fill-form-label {
        font-size: 0.9rem;
    }

    .fill-form-field input,
    .fill-form-field select,
    .fill-form-field textarea {
        padding: 14px 16px;
        font-size: 16px !important; /* prevent iOS zoom */
    }

    .fill-form-field .form-check {
        padding: 14px 16px 14px 48px;
        min-height: 52px;
    }

    .fill-form-submit {
        padding: 20px 16px;
    }

    .fill-form-submit .btn {
        padding: 16px 24px;
        font-size: 1rem;
    }

    /* ─── Analytics Dashboard ────────────────────────────────── */
    .kpi-card {
        padding: 16px;
    }

    .kpi-card .kpi-value {
        font-size: 1.5rem;
    }

    .kpi-card .kpi-label {
        font-size: 0.7rem;
    }

    .kpi-card .kpi-icon {
        font-size: 2rem;
        bottom: 12px;
        right: 12px;
    }

    /* ─── Submissions Table ──────────────────────────────────── */
    .submissions-card {
        border-radius: 12px;
        overflow-x: auto;
    }

    .submissions-card table {
        font-size: 0.8rem;
    }

    .submissions-card th,
    .submissions-card td {
        padding: 8px 10px;
        white-space: nowrap;
    }
}

@media (max-width: 500px) {
    .fill-form-hero h1 {
        font-size: 1.2rem;
    }

    .fill-form-body {
        padding: 20px 16px 12px;
    }

    .fill-form-field input,
    .fill-form-field select,
    .fill-form-field textarea {
        padding: 12px 14px;
    }

    .fill-form-field .form-check {
        padding: 12px 14px 12px 44px;
        min-height: 48px;
    }

    .kpi-card .kpi-value {
        font-size: 1.25rem;
    }
}