/**
 * Frontend Styles
 */

/* Dashboard */
.tt-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.tt-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.tt-dashboard-title {
    margin: 0;
    color: #333;
}

.tt-dashboard-back {
    padding: 8px 16px;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.tt-dashboard-back:hover {
    background: #0073aa;
    color: #fff;
}

/* Dashboard Tabs */
.tt-dashboard-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 0;
}

.tt-tab-btn {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #666;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: -2px;
}

.tt-tab-btn:hover {
    color: #0073aa;
    background: #f7f7f7;
}

.tt-tab-btn.active {
    color: #0073aa;
    border-bottom-color: #0073aa;
    background: transparent;
}

.tt-tab-logout {
    margin-left: auto;
    color: #dc3232;
}

.tt-tab-logout:hover {
    color: #a00;
    background: #ffeaea;
}

/* Tab Content */
.tt-dashboard-content {
    position: relative;
    min-height: 400px;
}

.tt-tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.tt-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tt-tab-content h3 {
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

/* Profile Overview */
.tt-profile-overview {
    margin-bottom: 30px;
}

.tt-profile-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tt-profile-header h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 24px;
}

.tt-profile-info {
    margin-bottom: 25px;
}

.tt-profile-info p {
    margin: 10px 0;
    font-size: 15px;
    color: #555;
}

.tt-profile-info strong {
    color: #333;
    margin-right: 10px;
}

.tt-profile-stats {
    display: flex;
    gap: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.tt-stat-item {
    text-align: center;
}

.tt-stat-value {
    display: block;
    font-size: 32px;
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 5px;
}

.tt-stat-label {
    display: block;
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Form Styles */
.tt-form {
    max-width: 700px;
}

.tt-form-row {
    display: flex;
    gap: 20px;
}

.tt-form-row .tt-form-group {
    flex: 1;
}

.tt-message {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.tt-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.tt-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.tt-info {
    background: #e7f3ff;
    border-left: 4px solid #0073aa;
    padding: 15px;
    margin: 15px 0;
    color: #555;
}

/* Questions Table */
.tt-Questions-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tt-Questions-table thead {
    background: #f7f7f7;
}

.tt-Questions-table th,
.tt-Questions-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.tt-Questions-table tbody tr:hover {
    background: #f9f9f9;
}

/* Status Badges */
.tt-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.tt-status-open {
    background: #e3f2fd;
    color: #1976d2;
}

.tt-status-pending_payment {
    background: #fff3e0;
    color: #f57c00;
}

.tt-status-waiting_customer {
    background: #fff9c4;
    color: #f9a825;
}

.tt-status-closed {
    background: #e8e8e8;
    color: #616161;
}

.tt-status-new_reply {
    background: #fff3e0;
    color: #f57c00;
    animation: pulse 2s ease-in-out infinite;
}

.tt-status-replied {
    background: #e8f5e9;
    color: #388e3c;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.tt-status-resolved {
    background: #e8f5e9;
    color: #388e3c;
}

/* Payment Status */
.tt-payment-status {
    font-size: 13px;
    color: #666;
}

.tt-payment-clickable {
    color: #0073aa !important;
    font-weight: 600;
    transition: color 0.3s;
}

.tt-payment-clickable:hover {
    color: #005a87 !important;
    text-decoration: underline;
}

/* Buttons */
.tt-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.tt-btn:hover {
    background: #005a87;
    color: #fff;
}

.tt-btn-primary {
    background: #0073aa;
}

.tt-btn-primary:hover {
    background: #005a87;
}

.tt-btn-view {
    background: #2271b1;
    padding: 6px 12px;
    font-size: 13px;
}

/* Create Question Form */
.tt-create-Question {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.tt-create-Question h2 {
    margin-bottom: 20px;
    color: #333;
}

.tt-payment-info {
    padding: 15px;
    background: #f0f8ff;
    border-left: 4px solid #0073aa;
    margin-bottom: 20px;
}

.tt-form-group {
    margin-bottom: 20px;
}

.tt-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.tt-form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.tt-form-control:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

textarea.tt-form-control {
    resize: vertical;
    min-height: 120px;
}

.tt-error-message {
    color: #dc3232;
    padding: 10px;
    background: #ffeaea;
    border-left: 4px solid #dc3232;
    margin-bottom: 15px;
}

/* Modal */
.tt-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.tt-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #888;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.tt-modal-large {
    max-width: 1000px;
}

.tt-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 15px;
    cursor: pointer;
}

.tt-modal-close:hover,
.tt-modal-close:focus {
    color: #000;
    text-decoration: none;
}

/* Question View */
.tt-Question-view h2 {
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.tt-Question-meta {
    background: #f7f7f7;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.tt-Question-meta p {
    margin: 5px 0;
}

.tt-Question-message {
    margin-bottom: 30px;
}

.tt-Question-message h3,
.tt-Question-replies h3 {
    margin-bottom: 15px;
    color: #333;
}

.tt-message-box {
    background: #f9f9f9;
    padding: 15px;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
    white-space: pre-wrap;
    line-height: 1.6;
}

/* Replies */
.tt-Question-replies {
    margin-bottom: 30px;
}

.tt-reply {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.tt-reply-customer {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.tt-reply-agent {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
}

.tt-reply-author {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.tt-reply-message {
    margin-bottom: 8px;
    white-space: pre-wrap;
    line-height: 1.6;
}

.tt-reply-date {
    font-size: 12px;
    color: #666;
}

/* Add Reply */
.tt-add-reply {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.tt-add-reply h3 {
    margin-bottom: 15px;
}

/* Second Payment Notice */
.tt-second-payment-notice {
    background: #fff3e0;
    border: 2px solid #ff9800;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.tt-second-payment-notice p {
    margin-bottom: 15px;
    font-size: 16px;
}

.tt-payment-notice-small {
    font-size: 13px;
    color: #666;
    font-style: italic;
    margin-bottom: 10px;
}

/* Stripe Card Element */
#tt-card-element,
#tt-new-Question-card-element {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
    background: #fff;
}

#tt-card-errors,
#tt-new-Question-card-errors {
    color: #dc3232;
    margin-bottom: 15px;
    font-size: 14px;
}

/* Loading State */
.tt-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .tt-modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
    
    .tt-Questions-table {
        font-size: 14px;
    }
    
    .tt-Questions-table th,
    .tt-Questions-table td {
        padding: 8px 10px;
    }
    
    .tt-dashboard-tabs {
        flex-direction: column;
    }
    
    .tt-tab-btn {
        width: 100%;
        text-align: left;
        border-bottom: 1px solid #ddd;
        margin-bottom: 0;
    }
    
    .tt-tab-btn.active {
        border-bottom-color: #0073aa;
    }
    
    .tt-tab-logout {
        margin-left: 0;
    }
    
    .tt-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .tt-profile-stats {
        flex-direction: column;
        gap: 15px;
    }
}

