﻿/* ═══════════════════════════════════════════════════
   UDEC Light Glassmorphism — Cards, Forms & Components
   ═══════════════════════════════════════════════════ */

/* ── Glass Card ── */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: var(--blur-card);
    -webkit-backdrop-filter: var(--blur-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.3s, border-color 0.3s;
}

    .glass-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: var(--accent-gradient);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .glass-card:hover {
        box-shadow: var(--shadow-card-hover);
        border-color: rgba(59, 109, 219, 0.2);
    }

/* ── Glass Surface ── */
.glass-surface {
    background: var(--bg-surface);
    backdrop-filter: var(--blur-surface);
    -webkit-backdrop-filter: var(--blur-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
}

/* ── Section Title ── */
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--accent-primary);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    margin-top: 0;
}

    .section-title .title-content {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .section-title .title-icon {
        font-size: 1rem;
        color: var(--accent-primary);
        width: 1.25rem;
        text-align: center;
    }

    .section-title h2 {
        font-size: 1rem;
        font-weight: 700;
        margin: 0;
        color: var(--text-primary);
    }

/* ── Field Label ── */
.field-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

    .field-label .required-mark {
        color: #dc2626;
        margin-left: 2px;
    }

/* ── Field Error ── */
.field-error {
    color: #dc2626;
    font-size: 0.72rem;
    margin-top: 0.25rem;
}

/* ── Inputs ── */
.neon-input,
.neon-select,
.neon-textarea {
    width: 100%;
    background: var(--bg-input);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-family: var(--font-family);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
}

    .neon-input::placeholder,
    .neon-textarea::placeholder {
        color: var(--text-muted);
    }

    .neon-input:focus,
    .neon-select:focus,
    .neon-textarea:focus {
        background: var(--bg-input-focus);
        border-color: var(--accent-primary);
        box-shadow: 0 0 0 3px rgba(59, 109, 219, 0.12);
    }

.neon-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

    .neon-select option {
        background: #ffffff;
        color: var(--text-primary);
    }

.neon-textarea {
    resize: vertical;
    min-height: 4rem;
}

/* ── Radio & Checkbox ── */
.neon-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.35rem;
}

.neon-radio-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
}

    .neon-radio-label input[type="radio"],
    .neon-radio-label input[type="checkbox"] {
        accent-color: var(--accent-primary);
        width: 1rem;
        height: 1rem;
    }

/* Card-style radio */
.radio-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-medium);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-surface);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

    .radio-card:hover {
        border-color: var(--accent-primary);
        background: rgba(59, 109, 219, 0.08);
    }

    .radio-card.active {
        border-color: var(--accent-primary);
        background: rgba(59, 109, 219, 0.12);
        color: var(--accent-dark);
        font-weight: 600;
        box-shadow: 0 0 12px rgba(59, 109, 219, 0.08);
    }

/* ── Autocomplete Dropdown (portal-rendered, uses fixed positioning from JS) ── */
.autocomplete-dropdown {
    max-height: 13rem;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
    list-style: none;
    margin: 0;
    padding: 0;
}

    .autocomplete-dropdown li {
        padding: 0.5rem 0.75rem;
        font-size: 0.82rem;
        cursor: pointer;
        color: var(--text-primary);
        transition: background 0.12s;
    }

        .autocomplete-dropdown li:hover {
            background: rgba(59, 109, 219, 0.1);
            color: var(--accent-dark);
        }

.autocomplete-empty {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* ── Context Panels ── */
.context-panel {
    border-radius: var(--radius-md);
    padding: 1rem;
    border: 1px solid;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.context-panel--purple {
    background: rgba(240, 236, 255, 0.7);
    border-color: rgba(201, 184, 255, 0.6);
}

.context-panel--green {
    background: rgba(236, 253, 245, 0.7);
    border-color: rgba(167, 243, 208, 0.6);
}

.context-panel--warning {
    background: rgba(255, 251, 235, 0.7);
    border-color: rgba(253, 230, 138, 0.6);
}

    .context-panel--warning .warning-text {
        color: #92400e;
        font-size: 0.85rem;
        font-weight: 500;
    }

.context-panel--amber {
    background: rgba(255, 251, 235, 0.7);
    border-color: rgba(253, 230, 138, 0.6);
}

/* ── Info Banner ── */
.info-banner {
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.82rem;
    border: 1px solid;
}

.info-banner--blue {
    background: rgba(59, 109, 219, 0.08);
    border-color: rgba(59, 109, 219, 0.2);
    color: var(--accent-dark);
}

/* ── File Input ── */
.file-input {
    display: block;
    width: 100%;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

    .file-input::file-selector-button {
        margin-right: 1rem;
        padding: 0.45rem 1rem;
        border-radius: var(--radius-md);
        border: 1px solid var(--accent-primary);
        background: rgba(255, 255, 255, 0.5);
        color: var(--accent-primary);
        font-size: 0.82rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
    }

        .file-input::file-selector-button:hover {
            background: rgba(59, 109, 219, 0.1);
        }

.file-input--amber::file-selector-button {
    color: #92400e;
    border-color: #d97706;
}

    .file-input--amber::file-selector-button:hover {
        background: rgba(253, 230, 138, 0.3);
    }

/* ── Confirmation Box ── */
.confirm-box {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: var(--bg-surface);
    backdrop-filter: var(--blur-surface);
    -webkit-backdrop-filter: var(--blur-surface);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

    .confirm-box input[type="checkbox"] {
        accent-color: var(--accent-primary);
        width: 1.15rem;
        height: 1.15rem;
        margin-top: 0.15rem;
        flex-shrink: 0;
    }

    .confirm-box span {
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--text-primary);
    }

/* ── Alerts ── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    text-align: center;
    font-size: 0.85rem;
    border: 1px solid;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.alert--success {
    background: rgba(236, 253, 245, 0.7);
    border-color: rgba(167, 243, 208, 0.6);
    color: #065f46;
    font-weight: 600;
}

.alert--error {
    background: rgba(254, 242, 242, 0.7);
    border-color: rgba(254, 202, 202, 0.6);
    color: #991b1b;
}

.alert--info {
    background: rgba(59, 109, 219, 0.08);
    border-color: rgba(59, 109, 219, 0.2);
    color: var(--accent-dark);
    font-weight: 500;
}

/* ── Profile Dropdown ── */
.profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--font-family);
}

    .profile-trigger:hover {
        color: var(--accent-primary);
        background: rgba(59, 109, 219, 0.08);
    }

.profile-dropdown {
    position: absolute;
    right: 0;
    margin-top: 0.25rem;
    width: 18rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: var(--blur-card);
    -webkit-backdrop-filter: var(--blur-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-dropdown);
    z-index: 40;
}

    .profile-dropdown .dropdown-header {
        padding: 0.5rem 0.75rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        font-size: 0.65rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-muted);
    }

    .profile-dropdown li {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.5rem 0.75rem;
        transition: background 0.15s;
    }

        .profile-dropdown li:hover {
            background: rgba(59, 109, 219, 0.06);
        }

    .profile-dropdown .profile-name {
        font-size: 0.82rem;
        color: var(--text-primary);
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .profile-dropdown .profile-detail {
        font-size: 0.7rem;
        color: var(--text-muted);
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .profile-dropdown .delete-btn {
        color: var(--text-muted);
        font-size: 0.72rem;
        opacity: 0;
        transition: opacity 0.2s, color 0.2s;
        background: none;
        border: none;
        cursor: pointer;
        margin-left: 0.5rem;
        flex-shrink: 0;
    }

    .profile-dropdown li:hover .delete-btn {
        opacity: 1;
    }

    .profile-dropdown .delete-btn:hover {
        color: #dc2626;
    }

    .profile-dropdown .dropdown-footer {
        padding: 0.5rem 0.75rem;
        border-top: 1px solid rgba(0, 0, 0, 0.06);
    }

    .profile-dropdown .clear-all {
        font-size: 0.72rem;
        color: #dc2626;
        background: none;
        border: none;
        cursor: pointer;
        font-family: var(--font-family);
        transition: color 0.2s;
    }

        .profile-dropdown .clear-all:hover {
            color: #b91c1c;
        }

/* ── Download link ── */
.download-link {
    color: var(--accent-primary);
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    margin-top: 0.35rem;
    transition: color 0.2s;
}

    .download-link:hover {
        color: var(--accent-dark);
        text-decoration: underline;
    }
