/**
 * Support Form Styles
 * Modern, responsive multi-step support form
 */

/* Wrapper */
.rd-support-form-wrapper {
    max-width: 700px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.rd-support-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.75rem;
    color: #1a1a1a;
}

/* Progress indicator */
.rd-support-progress {
    margin-bottom: 40px;
    position: relative;
}

.rd-support-progress-bar {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    position: absolute;
    top: 15px;
    left: 30px;
    right: 30px;
    z-index: 0;
}

.rd-support-progress-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #0073aa;
    border-radius: 2px;
    transition: width 0.3s ease;
    width: var(--progress, 0%);
}

.rd-support-progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.rd-progress-step {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.rd-progress-step.active {
    background: #0073aa;
    color: #fff;
}

.rd-progress-step.completed {
    background: #46b450;
    color: #fff;
}

.rd-support-step-label {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    color: #666;
}

/* Login prompt */
.rd-support-login-prompt {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 30px;
}

.rd-support-login-message {
    margin-bottom: 20px;
}

.rd-support-login-btn {
    display: inline-block;
    padding: 12px 30px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.2s;
}

.rd-support-login-btn:hover {
    background: #005a87;
    color: #fff;
}

/* Steps */
.rd-support-step {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.rd-support-greeting {
    font-size: 1.5rem;
    color: #1a1a1a;
    margin-bottom: 10px;
    text-align: center;
}

.rd-support-step-title {
    color: #666;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.1rem;
}

/* Problem type cards */
.rd-support-problem-types {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.rd-problem-type-card {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.rd-problem-type-card:hover {
    border-color: #0073aa;
    background: #f8fbfd;
}

.rd-problem-type-card.selected {
    border-color: #0073aa;
    background: #e8f4fc;
}

.rd-problem-type-icon {
    font-size: 2rem;
    line-height: 1;
}

.rd-problem-type-content {
    flex: 1;
}

.rd-problem-type-label {
    font-weight: 600;
    font-size: 1rem;
    color: #1a1a1a;
    display: block;
    margin-bottom: 4px;
}

.rd-problem-type-desc {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.4;
}

/* Product selection */
.rd-support-products {
    display: grid;
    gap: 12px;
}

.rd-product-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rd-product-card:hover {
    border-color: #0073aa;
}

.rd-product-card.selected {
    border-color: #0073aa;
    background: #e8f4fc;
}

.rd-product-title {
    font-weight: 500;
}

.rd-product-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: #46b450;
    color: #fff;
    border-radius: 4px;
}

.rd-support-product-skip {
    text-align: center;
    margin-top: 20px;
}

.rd-skip-link {
    color: #666;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
}

.rd-skip-link:hover {
    color: #0073aa;
}

/* Form fields */
.rd-support-field {
    margin-bottom: 20px;
}

.rd-support-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a1a1a;
}

.rd-support-field label .required {
    color: #dc3232;
}

.rd-support-field input[type="text"],
.rd-support-field input[type="email"],
.rd-support-field textarea,
.rd-support-field select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.rd-support-field input:focus,
.rd-support-field textarea:focus,
.rd-support-field select:focus {
    outline: none;
    border-color: #0073aa;
}

.rd-support-field textarea {
    resize: vertical;
    min-height: 120px;
}

.rd-support-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 600px) {
    .rd-support-field-row {
        grid-template-columns: 1fr;
    }
}

/* File upload */
.rd-support-upload-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}

.rd-support-upload-zone:hover,
.rd-support-upload-zone.dragover {
    border-color: #0073aa;
    background: #f0f7fc;
}

.rd-upload-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 10px;
}

.rd-upload-text {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
}

.rd-upload-hint {
    display: block;
    font-size: 0.85rem;
    color: #888;
}

.rd-support-file-list {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.rd-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f0f0f0;
    border-radius: 6px;
    font-size: 0.9rem;
}

.rd-file-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.rd-file-remove {
    cursor: pointer;
    color: #dc3232;
    font-size: 1.2rem;
    padding: 0 5px;
}

.rd-file-remove:hover {
    color: #a00;
}

/* Privacy */
.rd-support-privacy {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.rd-support-privacy label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: normal;
    cursor: pointer;
}

.rd-support-privacy input[type="checkbox"] {
    margin-top: 3px;
}

.rd-privacy-text a {
    color: #0073aa;
}

/* Summary */
.rd-support-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.rd-support-summary h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

.rd-summary-item {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.rd-summary-item:last-child {
    border-bottom: none;
}

.rd-summary-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

/* Navigation buttons */
.rd-support-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 15px;
}

.rd-support-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.rd-support-btn-back {
    background: #f0f0f0;
    color: #333;
}

.rd-support-btn-back:hover {
    background: #e0e0e0;
}

.rd-support-btn-next,
.rd-support-btn-submit {
    background: #0073aa;
    color: #fff;
    margin-left: auto;
}

.rd-support-btn-next:hover,
.rd-support-btn-submit:hover {
    background: #005a87;
}

.rd-support-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Error message */
.rd-support-error {
    background: #fce4e4;
    border: 1px solid #dc3232;
    color: #8b0000;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

/* Success message */
.rd-support-success {
    text-align: center;
    padding: 40px 20px;
}

.rd-success-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.rd-success-title {
    font-size: 1.5rem;
    color: #1a1a1a;
    margin-bottom: 15px;
}

.rd-success-message {
    color: #666;
    margin-bottom: 20px;
}

.rd-success-ticket {
    font-weight: 600;
    color: #0073aa;
    font-size: 1.1rem;
}

/* Honeypot - hidden from real users */
.rd-hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
}

/* Responsive */
@media (max-width: 768px) {
    .rd-support-form-wrapper {
        padding: 20px 15px;
        margin: 0 10px;
    }

    .rd-support-problem-types {
        grid-template-columns: 1fr;
    }

    .rd-support-navigation {
        flex-direction: column;
    }

    .rd-support-btn {
        width: 100%;
        justify-content: center;
    }

    .rd-support-btn-back {
        order: 2;
    }

    .rd-support-btn-next,
    .rd-support-btn-submit {
        order: 1;
        margin-left: 0;
    }
}

/* ===========================================
   User Ticket List Styles
   =========================================== */

.rd-support-tickets {
    max-width: 900px;
    margin: 0 auto;
}

.rd-tickets-list {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    padding: 30px;
}

.rd-tickets-title {
    margin: 0 0 25px;
    font-size: 1.5rem;
    color: #1a1a1a;
}

.rd-support-notice {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.rd-support-notice-info {
    background: #e8f4fc;
    border-left: 4px solid #0073aa;
    color: #1e4f7a;
}

.rd-support-notice-warning {
    background: #fff8e5;
    border-left: 4px solid #f0b849;
    color: #7a5800;
}

.rd-support-notice-error {
    background: #fce8e8;
    border-left: 4px solid #dc3545;
    color: #7a1e1e;
}

.rd-support-notice-success {
    background: #e8f8e8;
    border-left: 4px solid #46b450;
    color: #1e5a1e;
}

.rd-tickets-table-wrapper {
    overflow-x: auto;
}

.rd-tickets-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.rd-tickets-table th,
.rd-tickets-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e8e8e8;
}

.rd-tickets-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #444;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rd-tickets-table tbody tr:hover {
    background: #f8f9fa;
}

.rd-ticket-number a,
.rd-ticket-subject a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.rd-ticket-number a:hover,
.rd-ticket-subject a:hover {
    text-decoration: underline;
}

.rd-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.rd-status-open {
    background: #e8f4fc;
    color: #0073aa;
}

.rd-status-in_progress {
    background: #fff8e5;
    color: #9a6700;
}

.rd-status-waiting {
    background: #f3e8ff;
    color: #6b21a8;
}

.rd-status-on_hold {
    background: #f8f9fa;
    color: #6b7280;
}

.rd-status-resolved {
    background: #e8f8e8;
    color: #166534;
}

.rd-status-closed {
    background: #e8e8e8;
    color: #666;
}

/* ===========================================
   Ticket Detail View
   =========================================== */

.rd-ticket-detail {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    padding: 30px;
}

.rd-back-link {
    color: #0073aa;
    text-decoration: none;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 20px;
}

.rd-back-link:hover {
    text-decoration: underline;
}

.rd-ticket-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e8e8e8;
}

.rd-ticket-title {
    margin: 0 0 10px;
    font-size: 1.4rem;
    color: #1a1a1a;
}

.rd-ticket-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.rd-ticket-meta .rd-ticket-number {
    color: #666;
    font-size: 0.9rem;
    font-family: monospace;
}

.rd-ticket-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.rd-info-item {
    font-size: 0.95rem;
}

.rd-info-item strong {
    display: block;
    color: #666;
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.rd-ticket-attachments {
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.rd-attachment-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
}

.rd-attachment-list li {
    padding: 5px 0;
}

.rd-attachment-list a {
    color: #0073aa;
    text-decoration: none;
}

.rd-attachment-list a:hover {
    text-decoration: underline;
}

.rd-file-size {
    color: #888;
    font-size: 0.85rem;
    margin-left: 8px;
}

/* ===========================================
   Message History
   =========================================== */

.rd-ticket-messages h4 {
    margin: 0 0 20px;
    font-size: 1.1rem;
    color: #1a1a1a;
}

.rd-no-messages {
    color: #666;
    font-style: italic;
}

.rd-message {
    margin-bottom: 20px;
    padding: 15px 20px;
    border-radius: 12px;
    max-width: 85%;
}

.rd-message-user {
    background: #e8f4fc;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.rd-message-admin {
    background: #f8f9fa;
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

.rd-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.rd-message-author {
    font-weight: 600;
    color: #1a1a1a;
}

.rd-message-date {
    color: #888;
}

.rd-message-content {
    color: #333;
    line-height: 1.6;
}

.rd-message-content p {
    margin: 0 0 10px;
}

.rd-message-content p:last-child {
    margin-bottom: 0;
}

.rd-message-attachments {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.1);
    font-size: 0.9rem;
}

/* ===========================================
   Reply Form
   =========================================== */

.rd-ticket-reply {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #e8e8e8;
}

.rd-ticket-reply h4 {
    margin: 0 0 15px;
    font-size: 1.1rem;
    color: #1a1a1a;
}

.rd-reply-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.rd-reply-form textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.rd-reply-form .rd-btn {
    margin-top: 15px;
}

.rd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rd-btn-primary {
    background: #0073aa;
    color: #fff;
}

.rd-btn-primary:hover {
    background: #005a87;
}

.rd-btn-primary:disabled {
    background: #a0a0a0;
    cursor: not-allowed;
}

.rd-reply-status {
    margin-top: 12px;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.95rem;
}

.rd-reply-status:empty {
    display: none;
}

.rd-reply-status-success {
    background: #e8f8e8;
    color: #166534;
}

.rd-reply-status-error {
    background: #fce8e8;
    color: #dc3545;
}

/* ===========================================
   Responsive - Tickets
   =========================================== */

@media (max-width: 768px) {
    .rd-tickets-list,
    .rd-ticket-detail {
        padding: 20px 15px;
        margin: 0 10px;
    }

    .rd-tickets-table th,
    .rd-tickets-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }

    .rd-ticket-category,
    .rd-ticket-date {
        display: none;
    }

    .rd-message {
        max-width: 95%;
    }

    .rd-ticket-info {
        grid-template-columns: 1fr;
    }

    .rd-ticket-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}
