/* Gravity Desk Main Styles */

/* Dashboard Styles */
.gravity-desk-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.gravity-desk-dashboard h2 {
    margin-bottom: 20px;
    font-size: 24px;
    color: #23282d;
}

/* Statistics */
.gd-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.gd-stat {
    flex: 1;
    min-width: 150px;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.gd-stat-value {
    display: block;
    font-size: 32px;
    font-weight: 600;
    color: #0073aa;
    margin-bottom: 5px;
}

.gd-stat-label {
    display: block;
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Ticket Table */
.gd-ticket-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.gd-ticket-table thead {
    background: #f4f4f4;
}

.gd-ticket-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #23282d;
    border-bottom: 1px solid #e1e1e1;
}

.gd-ticket-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e1e1e1;
}

.gd-ticket-table tbody tr:hover {
    background: #f9f9f9;
}

/* Status Badges */
.gd-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.gd-status-new {
    background: #e3f2fd;
    color: #1976d2;
}

.gd-status-in-progress {
    background: #fff3cd;
    color: #856404;
}

.gd-status-waiting-for-user {
    background: #fff3e0;
    color: #f57c00;
}

.gd-status-resolved {
    background: #d4edda;
    color: #155724;
}

.gd-status-closed {
    background: #e2e3e5;
    color: #383d41;
}

/* Buttons */
.gd-button,
.button.gd-button-small {
    display: inline-block;
    padding: 8px 16px;
    background: #0073aa;
    color: white !important;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.gd-button:hover,
.button.gd-button-small:hover {
    background: #005a87;
    color: white !important;
}

.button.gd-button-small {
    padding: 6px 12px;
    font-size: 13px;
}

/* Ticket Detail View */
.gd-ticket-detail {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
}

.gd-ticket-header {
    padding: 20px;
    border-bottom: 1px solid #e1e1e1;
    background: #f9f9f9;
}

.gd-back-link {
    display: inline-block;
    margin-bottom: 10px;
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
}

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

.gd-ticket-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 10px;
}

.gd-ticket-id {
    font-weight: 600;
    color: #666;
}

.gd-priority {
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.gd-priority-low {
    background: #e8f5e9;
    color: #2e7d32;
}

.gd-priority-medium {
    background: #fff3cd;
    color: #856404;
}

.gd-priority-high {
    background: #ffe0b2;
    color: #e65100;
}

.gd-priority-urgent {
    background: #ffebee;
    color: #c62828;
}

/* Ticket Content */
.gd-ticket-content {
    padding: 20px;
}

.gd-original-message,
.gd-conversation {
    margin-bottom: 30px;
}

.gd-original-message h3,
.gd-conversation h3 {
    margin-bottom: 15px;
    font-size: 18px;
    color: #23282d;
}

.gd-message-info {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
}

.gd-message-body {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #0073aa;
}

/* Replies */
.gd-replies {
    margin-bottom: 20px;
}

.gd-reply {
    margin-bottom: 20px;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    overflow: hidden;
}

.gd-reply-header {
    padding: 10px 15px;
    background: #f4f4f4;
    border-bottom: 1px solid #e1e1e1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gd-reply-content {
    padding: 15px;
    background: #fff;
}

.gd-reply-staff .gd-reply-header {
    background: #e3f2fd;
}

.gd-reply-user .gd-reply-header {
    background: #f9f9f9;
}

.gd-reply-internal {
    border-color: #ffc107;
}

.gd-reply-internal .gd-reply-header {
    background: #fff3cd;
}

.gd-badge-staff,
.gd-badge-internal {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.gd-badge-staff {
    background: #0073aa;
    color: white;
}

.gd-badge-internal {
    background: #ffc107;
    color: #856404;
}

.gd-reply-date {
    margin-left: auto;
    color: #666;
    font-size: 13px;
}

/* Reply Form */
.gd-reply-form {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
    border: 1px solid #e1e1e1;
}

.gd-reply-form h4 {
    margin-bottom: 15px;
    font-size: 16px;
    color: #23282d;
}

.gd-form-field {
    margin-bottom: 15px;
}

.gd-form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #23282d;
}

.gd-form-field textarea,
.gd-form-field input[type="text"],
.gd-form-field input[type="email"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.gd-form-field textarea {
    resize: vertical;
    min-height: 100px;
}

.gd-form-field small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

/* Attachments */
.gd-attachments {
    margin-top: 15px;
}

.gd-attachments h4 {
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
}

.gd-attachments ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gd-attachments li {
    padding: 5px 0;
}

.gd-attachments a {
    color: #0073aa;
    text-decoration: none;
}

.gd-attachments a:hover {
    text-decoration: underline;
}

/* Messages */
.gd-no-tickets,
.gd-no-replies,
.gd-ticket-closed-notice {
    text-align: center;
    padding: 40px 20px;
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    color: #666;
}

.gravity-desk-notice {
    padding: 20px;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    text-align: center;
    margin: 20px 0;
}

.gd-error {
    padding: 15px;
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
    border-radius: 4px;
    margin: 20px 0;
}

#gd-reply-message-box {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
}

#gd-reply-message-box.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#gd-reply-message-box.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Admin Tab Styles */
.gravity-desk-admin-tab {
    padding: 20px;
    background: #fff;
}

.gd-meta-box {
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.gd-meta-box h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    color: #23282d;
}

.gd-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.gd-meta-row label {
    min-width: 120px;
    font-weight: 600;
}

.gd-meta-row select {
    min-width: 150px;
    padding: 5px;
}

.gd-submission-content {
    background: #fff;
    padding: 15px;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
}

.gd-message-content {
    background: #f9f9f9;
    padding: 10px;
    border-left: 3px solid #0073aa;
    margin: 10px 0;
}

.gd-replies-container {
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 10px;
    background: #fafafa;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
}

.gd-reply-options {
    margin: 10px 0;
}

.gd-reply-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
}

/* Admin Dashboard */
.gd-admin-dashboard {
    padding: 20px;
}

.gd-statistics,
.gd-recent-tickets,
.gd-quick-actions {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.gd-stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.gd-stat-card {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    border: 1px solid #e1e1e1;
}

.gd-stat-number {
    font-size: 28px;
    font-weight: bold;
    color: #0073aa;
}

.gd-action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

/* Reports */
.gd-reports {
    padding: 20px;
}

.gd-report-section {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.gd-metric-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.gd-metric-card {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
    text-align: center;
    border: 1px solid #e1e1e1;
}

.gd-metric-value {
    font-size: 24px;
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 5px;
}

.gd-metric-label {
    font-size: 14px;
    color: #666;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .gravity-desk-dashboard {
        padding: 10px;
    }
    
    .gd-stats {
        flex-direction: column;
    }
    
    .gd-ticket-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .gd-ticket-meta {
        flex-wrap: wrap;
    }
    
    .gd-meta-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .gd-action-buttons {
        flex-direction: column;
    }
    
    .gd-action-buttons .button {
        width: 100%;
    }
}