/**
 * Customer Support Portal CSS
 *
 * Comprehensive styling for the frontend ticket management portal
 *
 * @package    Customersupport
 * @subpackage Customersupport/public/css
 */

/* Portal Container */
.customersupport-portal {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Portal Header */
.portal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(300deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.portal-title h1 {
    margin: 0 0 5px 0;
    font-size: 28px;
    font-weight: 600;
    display: flex;
    align-items: center;
    color: white;
    gap: 10px;
}

.portal-title h1 .dashicons {
    color: white;
}

.dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
    vertical-align: middle !important;
    text-align: center;
}

.portal-title p {
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
    color: white;
}

.portal-actions {
    display: flex;
    gap: 10px;
}

/* Email Authentication */
.email-auth-section {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 30px;
}

.auth-form h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 24px;
}

.auth-form p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 16px;
}

.auth-form .form-group {
    display: flex;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto;
}

.auth-form input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Portal Navigation */
.portal-nav {
    margin-bottom: 30px;
}

.nav-tabs {
    display: flex;
    gap: 5px;
    background: #f8f9fa;
    padding: 5px;
    border-radius: 12px;
    overflow-x: auto;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-tab:hover {
    background: #e9ecef;
    color: #333;
}

.nav-tab.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.nav-tab .dashicons {
    font-size: 16px;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.stat-icon.open {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.stat-icon.pending {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.stat-icon.resolved {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.stat-icon.closed {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.stat-icon .dashicons {
    font-size: 24px;
}

.stat-content h3 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.stat-content p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.dashboard-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.dashboard-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.activity-item:hover {
    background: #e9ecef;
}

.activity-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.activity-content h5 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 14px;
}

.activity-content p {
    margin: 0;
    color: #666;
    font-size: 12px;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #333;
}

.quick-action-btn:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transform: translateY(-2px);
}

.quick-action-btn .dashicons {
    font-size: 24px;
    color: var(--primary-color);
}

.quick-action-btn span {
    font-size: 14px;
    font-weight: 500;
}

/* Tickets Tab */
.tickets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.tickets-header h3 {
    margin: 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.tickets-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 10px 40px 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    width: 250px;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.search-box .dashicons {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.tickets-controls select {
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.tickets-controls select:focus {
    outline: none;
    border-color: #667eea;
}

.tickets-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ticket-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.ticket-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.ticket-info h4 {
    margin: 0 0 5px 0;
    color: #667eea;
    font-size: 16px;
    font-weight: 600;
}

.ticket-info h5 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 500;
}

.ticket-meta {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ticket-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.ticket-status.open {
    background: #d4edda;
    color: #155724;
}

.ticket-status.pending {
    background: #fff3cd;
    color: #856404;
}

.ticket-status.resolved {
    background: #d1ecf1;
    color: #0c5460;
}

.ticket-status.closed {
    background: #f8d7da;
    color: #721c24;
}

.ticket-priority {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.ticket-priority.low {
    background: #e2e3e5;
    color: #495057;
}

.ticket-priority.medium {
    background: #cce5ff;
    color: #004085;
}

.ticket-priority.high {
    background: #ffeaa7;
    color: #856404;
}

.ticket-priority.urgent {
    background: #ffb3ba;
    color: #721c24;
}

.ticket-content p {
    margin: 0 0 15px 0;
    color: #666;
    line-height: 1.6;
}

.ticket-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.ticket-date {
    color: #999;
    font-size: 12px;
}

.ticket-actions {
    display: flex;
    gap: 10px;
}

/* Create Ticket Form */
.create-ticket-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.create-ticket-section h3 {
    margin: 0 0 25px 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.portal-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.file-preview {
    margin-top: 10px;
}

.file-list {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.file-list h5 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 14px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 14px;
}

.file-name {
    font-weight: 500;
    color: #333;
}

.file-size {
    color: #666;
    font-size: 12px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* Profile Tab */
.profile-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.profile-section h3 {
    margin: 0 0 25px 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.profile-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.profile-item label {
    font-weight: 600;
    color: #333;
}

.profile-item span {
    color: #666;
}

.profile-actions {
    display: flex;
    gap: 15px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.modal-close:hover {
    background: #e9ecef;
}

.modal-body {
    padding: 25px;
}

.ticket-detail-view {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.ticket-header-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.ticket-header-detail h3 {
    margin: 0;
    color: #333;
    font-size: 22px;
    font-weight: 600;
}

.ticket-status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

.ticket-meta-detail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.meta-item label {
    font-weight: 600;
    color: #333;
    font-size: 12px;
    text-transform: uppercase;
}

.meta-item span {
    color: #666;
    font-size: 14px;
}

.priority-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.ticket-description-detail h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.ticket-description-detail p {
    margin: 0;
    color: #666;
    line-height: 1.6;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.ticket-replies h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.replies-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.reply-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.reply-author {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.reply-date {
    color: #666;
    font-size: 12px;
}

.reply-content {
    color: #666;
    line-height: 1.6;
}

.reply-form h5 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.reply-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    min-height: 100px;
    margin-bottom: 15px;
}

.reply-form textarea:focus {
    outline: none;
    border-color: #667eea;
}

.reply-actions {
    display: flex;
    justify-content: flex-end;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255,255,255,0.9);
    backdrop-filter: blur(5px);
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #667eea;
}

.loading-spinner .dashicons {
    font-size: 48px;
    animation: spin 1s linear infinite;
}

.loading-spinner p {
    margin: 15px 0 0 0;
    font-size: 16px;
    font-weight: 500;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 8px;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Loading Placeholder */
.loading-placeholder {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

.no-tickets {
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-tickets p {
    margin: 0;
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .customersupport-portal {
        padding: 10px;
    }
    
    .portal-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .portal-title h1 {
        font-size: 24px;
    }
    
    .portal-actions {
        width: 100%;
        justify-content: center;
    }
    
    .nav-tabs {
        flex-wrap: wrap;
    }
    
    .nav-tab {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tickets-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tickets-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tickets-controls .search-box input {
        width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .profile-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .profile-actions {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .ticket-meta-detail {
        grid-template-columns: 1fr;
    }
    
    .ticket-header-detail {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .portal-title h1 {
        font-size: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
    
    .create-ticket-section,
    .profile-section {
        padding: 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
}
