/* Feedback Form Styles */
.feedback-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    font-family: inherit;
}

.feedback-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 1.75rem;
    backdrop-filter: blur(8px);
}

.feedback-intro {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
}

.feedback-intro-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.12);
    padding: 0.65rem;
    border-radius: 0.6rem;
    flex-shrink: 0;
}

.feedback-intro-text h3 {
    margin: 0 0 0.35rem 0;
    font-size: 1.15rem;
    font-weight: 600;
}

.feedback-intro-text p {
    margin: 0;
    font-size: 0.925rem;
    line-height: 1.5;
    opacity: 0.8;
}

/* Form Styles */
.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.form-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.form-label .required-star {
    color: #ef4444;
    margin-left: 0.25rem;
}

.form-label .optional-badge {
    font-size: 0.75rem;
    font-weight: normal;
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.07);
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
}

.form-input,
.form-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: inherit;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 0.6rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.6;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #6366f1;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-hint {
    font-size: 0.8rem;
    opacity: 0.65;
    margin-top: 0.15rem;
}

/* Submit Button & Actions */
.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 0.5rem;
}

.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    border-radius: 0.6rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Spinner */
.spinner {
    display: none;
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.btn-submit.loading .spinner {
    display: inline-block;
}

.btn-submit.loading .btn-icon {
    display: none;
}

/* Alerts */
.feedback-alert {
    display: none;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.25rem;
    border-radius: 0.6rem;
    font-size: 0.925rem;
    line-height: 1.5;
    animation: fadeInAlert 0.25s ease-out forwards;
}

@keyframes fadeInAlert {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback-alert.show {
    display: flex;
}

.feedback-alert-success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.feedback-alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.feedback-alert .alert-icon {
    font-size: 1.35rem;
    line-height: 1;
    flex-shrink: 0;
}

/* Light theme overrides if class is not dark */
html:not(.dark) .feedback-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
}

html:not(.dark) .feedback-intro {
    border-bottom-color: #e2e8f0;
}

html:not(.dark) .form-input,
html:not(.dark) .form-textarea {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

html:not(.dark) .form-input:focus,
html:not(.dark) .form-textarea:focus {
    background: #ffffff;
    border-color: #6366f1;
}

html:not(.dark) .form-label .optional-badge {
    background: #f1f5f9;
    color: #64748b;
}

/* ==========================================================================
   Feedback Viewer & Management UI Styles
   ========================================================================== */

.viewer-header-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    backdrop-filter: blur(8px);
}

.viewer-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.viewer-search-box {
    position: relative;
    flex: 1;
    min-width: 240px;
    max-width: 450px;
}

.viewer-search-box .search-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.2rem;
    pointer-events: none;
}

.viewer-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 0.9rem 0.65rem 2.6rem;
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: inherit;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.viewer-search-input:focus {
    outline: none;
    border-color: #6366f1;
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.viewer-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.badge-count {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.btn-secondary-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.95rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: inherit;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.5rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-secondary-action:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.btn-danger-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.95rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger-action:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.45);
    color: #fca5a5;
    transform: translateY(-1px);
}

/* Feedback List & Cards */
.feedback-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.feedback-item-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 1.35rem 1.5rem;
    position: relative;
    backdrop-filter: blur(8px);
    transition: all 0.25s ease;
    overflow: hidden;
}

.feedback-item-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.3);
}

.feedback-item-card.deleting {
    opacity: 0;
    transform: translateX(30px);
    pointer-events: none;
}

.card-top-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.card-subject-group {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.feedback-id-tag {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 0.35rem;
    background: rgba(99, 102, 241, 0.18);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.25);
    text-transform: uppercase;
}

.card-subject-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.4;
    color: inherit;
    word-break: break-word;
}

.card-meta-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.85rem;
    font-size: 0.825rem;
    opacity: 0.85;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.meta-chip .material-symbols-outlined {
    font-size: 1rem;
    opacity: 0.75;
}

.email-chip {
    color: #38bdf8;
    text-decoration: none;
}

.email-chip:hover {
    text-decoration: underline;
}

.feedback-body-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    padding: 1rem 1.15rem;
    margin-bottom: 1rem;
}

.feedback-text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
}

.card-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.agent-details {
    font-size: 0.775rem;
    opacity: 0.6;
    max-width: 60%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-card-action {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.75rem;
    border-radius: 0.45rem;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-card-action:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-card-delete {
    color: #f87171;
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-card-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

/* Empty State */
.empty-feedbacks {
    text-align: center;
    padding: 3.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
}

.empty-feedbacks-icon {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 0.75rem;
}

.empty-feedbacks h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.empty-feedbacks p {
    margin: 0 0 1.25rem 0;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Light Theme overrides for Viewer */
html:not(.dark) .viewer-header-card,
html:not(.dark) .feedback-item-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

html:not(.dark) .viewer-search-input {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

html:not(.dark) .viewer-search-input:focus {
    background: #ffffff;
    border-color: #6366f1;
}

html:not(.dark) .viewer-search-box .search-icon {
    color: #94a3b8;
}

html:not(.dark) .feedback-body-box {
    background: #f8fafc;
    border-color: #e2e8f0;
}

html:not(.dark) .card-meta-chips {
    border-bottom-color: #e2e8f0;
}

html:not(.dark) .empty-feedbacks {
    background: #f8fafc;
    border-color: #cbd5e1;
}

html:not(.dark) .empty-feedbacks-icon {
    color: #94a3b8;
}

html:not(.dark) .btn-secondary-action {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

html:not(.dark) .btn-secondary-action:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

