/* ===========================
   Profile Page Styles
   Extracted from Profile.razor inline CSS
   =========================== */

.profile-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 800px;
}

.profile-card {
    width: 100%;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.info-row:last-child {
    border-bottom: none;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.form-actions,
.card-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.username-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===========================
   Username Modal
   =========================== */
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(15, 23, 42, 0.5) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 9999 !important;
    padding: 1rem;
}

.profile-modal {
    position: relative;
    background: white !important;
    border-radius: 1rem;
    padding: 1.5rem;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: none !important;
    z-index: 10000 !important;
}

@media (max-width: 640px) {
    .profile-modal {
        padding: 1.25rem;
        max-width: calc(100% - 2rem);
        margin: 0 1rem;
    }
}

/* Close button */
.modal-close-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal-close-btn:hover {
    background: #f1f5f9;
    color: #475569;
}

/* Modal header */
.profile-modal .modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0;
    border-bottom: none;
}

.profile-modal .modal-icon {
    font-size: 2.5rem;
    color: var(--chefmike-orange);
    margin-bottom: 0.75rem;
    display: block;
    width: 100%;
    text-align: center;
}

.profile-modal .modal-title {
    display: block;
    width: 100%;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.375rem 0;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.profile-modal .modal-subtitle {
    display: block;
    width: 100%;
    font-size: 0.8125rem;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
    font-weight: 400;
}

/* Modal body */
.profile-modal .modal-body {
    margin-bottom: 1.25rem;
}

.profile-modal .form-label {
    display: block;
    color: #475569;
    font-weight: 600;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-modal .form-group {
    margin-bottom: 0.75rem;
}

/* Modal footer */
.profile-modal .modal-footer {
    display: flex;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Force correct button styles within modal */
.profile-modal .btn-primary,
.modal .btn-primary {
    background-color: #E85D33 !important;
    border-color: #E85D33 !important;
    color: white !important;
    padding: 0.75rem 1.5rem !important;
    font-weight: 500 !important;
    border-radius: 0.75rem !important;
    transition: all 0.15s ease !important;
}

.profile-modal .btn-primary:hover:not(:disabled),
.modal .btn-primary:hover:not(:disabled) {
    background-color: #CC4A24 !important;
    border-color: #CC4A24 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(232, 93, 51, 0.3) !important;
}

.profile-modal .btn-primary:active:not(:disabled),
.modal .btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.profile-modal .btn-primary:disabled,
.modal .btn-primary:disabled {
    background-color: #e5e7eb !important;
    border-color: #e5e7eb !important;
    color: #9ca3af !important;
    cursor: not-allowed;
    opacity: 0.6;
}

.profile-modal .btn-outline,
.profile-modal .btn-text,
.modal .btn-outline,
.modal .btn-text {
    padding: 0.75rem 1.5rem !important;
    font-weight: 500 !important;
    border-radius: 0.75rem !important;
    transition: all 0.15s ease !important;
    color: #475569 !important;
    border: 2px solid #e2e8f0 !important;
    background: white !important;
}

.profile-modal .btn-outline:hover:not(:disabled),
.profile-modal .btn-text:hover:not(:disabled),
.modal .btn-outline:hover:not(:disabled),
.modal .btn-text:hover:not(:disabled) {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

.profile-modal .btn i,
.modal .btn i {
    margin-right: 0.5rem;
}

/* Username Input */
.username-input-group {
    position: relative;
}

.username-prefix {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-weight: 600;
    font-size: 0.9375rem;
}

.username-input {
    padding: 0.75rem 1rem 0.75rem 2rem;
    width: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    background: #f8fafc;
    color: #0f172a;
    transition: all 0.15s ease;
    font-weight: 400;
}

.username-input::placeholder {
    color: #94a3b8;
}

.username-input:hover {
    background: white;
    border-color: #cbd5e1;
}

.username-input:focus {
    outline: none;
    border-color: var(--chefmike-orange);
    background: white;
    box-shadow: 0 0 0 3px rgba(232, 93, 51, 0.1);
}

/* Validation Messages */
.validation-message {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    padding: 0;
    border-radius: 0;
    background: transparent;
    font-weight: 500;
}

.validation-message i {
    font-size: 0.875rem;
}

.validation-message.error {
    color: #dc2626;
}

.validation-message.success {
    color: #059669;
}

.validation-message.info {
    color: #64748b;
}

/* Get Suggestions Button */
.get-suggestions-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 1rem;
    background: transparent;
    border: 1.5px dashed #cbd5e1;
    border-radius: 0.5rem;
    color: #64748b;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-top: 0.75rem;
}

.get-suggestions-btn:hover:not(:disabled) {
    border-color: var(--chefmike-orange);
    color: var(--chefmike-orange);
    background: rgba(232, 93, 51, 0.04);
}

.get-suggestions-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Suggestions Section */
.suggestions-section {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
}

.suggestions-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.5rem;
}

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.suggestion-chip {
    padding: 0.375rem 0.75rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    font-size: 0.75rem;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 500;
}

.suggestion-chip:hover {
    border-color: var(--chefmike-orange);
    background: rgba(232, 93, 51, 0.04);
    color: var(--chefmike-orange);
}

/* Form Sections */
.form-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    grid-column: 1 / -1;
    margin-top: 1rem;
}

.form-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ===========================
   Theme Selector
   =========================== */
.theme-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.theme-option {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.theme-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.theme-option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
}

.theme-option input[type="radio"]:checked + .theme-option-content {
    border-color: var(--chefmike-orange);
    background: rgba(232, 93, 51, 0.08);
    box-shadow: 0 0 0 3px rgba(232, 93, 51, 0.1);
}

.theme-option:not(:has(input:checked)):hover .theme-option-content {
    border-color: var(--gray-400);
    background: var(--gray-50);
}

.theme-option i {
    font-size: 1.75rem;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.theme-option input[type="radio"]:checked + .theme-option-content i {
    color: var(--chefmike-orange);
}

.theme-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.theme-description {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ===========================
   Multi-Select Dropdown (Select2 Style)
   =========================== */
.select2-wrapper {
    position: relative;
}

.select2-selection {
    min-height: 2.75rem;
    padding: 0.5rem 2.5rem 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1.5px solid var(--gray-300);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.select2-selection:hover {
    border-color: var(--gray-400);
}

.select2-selection:focus-within {
    border-color: var(--chefmike-orange);
    box-shadow: 0 0 0 3px rgba(232, 93, 51, 0.1);
}

.select2-arrow {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.75rem;
    pointer-events: none;
}

.select2-placeholder {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.select2-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    flex: 1;
}

.select2-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    background: var(--chefmike-orange);
    color: white;
    border-radius: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.5;
}

.select2-tag-remove {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 0.875rem;
    height: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
    font-size: 0.75rem;
}

.select2-tag-remove:hover {
    background: rgba(255, 255, 255, 0.2);
}

.select2-dropdown {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 300px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.select2-search {
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

.select2-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}

.select2-search-input:focus {
    border-color: var(--chefmike-orange);
}

.select2-results {
    overflow-y: auto;
    max-height: 220px;
}

.select2-result {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: background-color 0.15s;
}

.select2-result:hover {
    background: var(--gray-50);
}

.select2-result:active {
    background: var(--gray-100);
}

.select2-no-results {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-style: italic;
}

.select2-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: transparent;
}

/* Loading/Error States */
.loading-state,
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.error-state i {
    font-size: 3rem;
    color: var(--color-warning);
    margin-bottom: 1rem;
}

.error-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.error-state p {
    color: var(--text-secondary);
    margin: 0 0 1.5rem 0;
}

/* Muted Text */
.text-muted {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-style: italic;
    padding: 1rem;
    text-align: center;
}

@media (max-width: 768px) {
    .theme-selector {
        grid-template-columns: 1fr;
    }

    .select2-dropdown {
        max-width: 100%;
    }
}

/* ===========================
   Dark Mode Support
   =========================== */

[data-theme="dark"] .profile-modal,
[data-theme="dark"] .modal {
    background: #1e293b !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .modal-close-btn {
    color: #64748b;
}

[data-theme="dark"] .modal-close-btn:hover {
    background: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .profile-modal .modal-icon {
    color: var(--chefmike-orange);
}

[data-theme="dark"] .profile-modal .modal-title,
[data-theme="dark"] .modal .modal-title {
    color: #f8fafc;
}

[data-theme="dark"] .profile-modal .modal-subtitle,
[data-theme="dark"] .modal .modal-subtitle {
    color: #94a3b8;
}

[data-theme="dark"] .profile-modal .form-label,
[data-theme="dark"] .modal .form-label {
    color: #94a3b8;
}

[data-theme="dark"] .profile-modal .modal-footer,
[data-theme="dark"] .modal .modal-footer {
    border-top-color: #334155;
}

[data-theme="dark"] .username-input {
    background: #0f172a;
    color: #f8fafc;
    border-color: #334155;
}

[data-theme="dark"] .username-input::placeholder {
    color: #64748b;
}

[data-theme="dark"] .username-input:hover {
    background: #0f172a;
    border-color: #475569;
}

[data-theme="dark"] .username-input:focus {
    border-color: var(--chefmike-orange);
    background: #0f172a;
    box-shadow: 0 0 0 3px rgba(232, 93, 51, 0.15);
}

[data-theme="dark"] .username-prefix {
    color: #94a3b8;
}

[data-theme="dark"] .get-suggestions-btn {
    border-color: #475569;
    color: #94a3b8;
}

[data-theme="dark"] .get-suggestions-btn:hover:not(:disabled) {
    border-color: var(--chefmike-orange);
    color: var(--chefmike-orange);
    background: rgba(232, 93, 51, 0.1);
}

[data-theme="dark"] .profile-modal .btn-outline,
[data-theme="dark"] .profile-modal .btn-text,
[data-theme="dark"] .modal .btn-outline,
[data-theme="dark"] .modal .btn-text {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .profile-modal .btn-outline:hover:not(:disabled),
[data-theme="dark"] .profile-modal .btn-text:hover:not(:disabled),
[data-theme="dark"] .modal .btn-outline:hover:not(:disabled),
[data-theme="dark"] .modal .btn-text:hover:not(:disabled) {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .suggestions-section {
    background: #0f172a;
    border-color: #334155;
}

[data-theme="dark"] .suggestions-label {
    color: #94a3b8;
}

[data-theme="dark"] .suggestion-chip {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

[data-theme="dark"] .suggestion-chip:hover {
    background: rgba(232, 93, 51, 0.1);
    border-color: var(--chefmike-orange);
    color: var(--chefmike-orange);
}

[data-theme="dark"] .select2-search-input {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .select2-search-input:focus {
    border-color: var(--chefmike-orange-light);
}

[data-theme="dark"] .select2-result:hover {
    background: var(--hover-bg);
}

[data-theme="dark"] .select2-placeholder {
    color: var(--text-tertiary);
}

[data-theme="dark"] .theme-option:not(:has(input:checked)):hover .theme-option-content {
    background: var(--bg-tertiary);
    border-color: var(--border-heavy);
}
