/**
 * PCG Tech Portal - Main Styles
 * Mobile-first, clean professional design
 */

/* Reset & Base */
.pcg-portal {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1f2937;
    background: #f3f4f6;
    min-height: 100vh;
    position: relative;
}

.pcg-portal * {
    box-sizing: border-box;
}

/* Header-only mode (for use on other pages) */
.pcg-portal.pcg-portal-header-only {
    min-height: auto;
    background: transparent;
}

/* Header */
.pcg-header {
    background: #005997;
    color: white;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pcg-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
}

.pcg-logo-area {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.pcg-version {
    font-size: 10px;
    opacity: 0.7;
    margin-bottom: 2px;
}

.pcg-logo {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.pcg-user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pcg-user-name {
    font-size: 13px;
    opacity: 0.9;
}

/* Buttons */
.pcg-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.pcg-btn-primary {
    background: #2563eb;
    color: white;
}

.pcg-btn-primary:hover {
    background: #1d4ed8;
}

.pcg-btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.pcg-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
}

.pcg-btn-small {
    padding: 6px 10px;
    font-size: 12px;
}

/* Header buttons - white style */
.pcg-header .pcg-btn-small {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.pcg-header .pcg-btn-small:hover {
    background: rgba(255, 255, 255, 0.25);
}

.pcg-btn-icon {
    padding: 8px;
    background: transparent;
    border: none;
    color: #6b7280;
}

.pcg-btn-icon:hover {
    background: #e5e7eb;
    border-radius: 6px;
}

.pcg-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* List View */
.pcg-list-view {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

/* Filters Bar */
.pcg-filters-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.pcg-status-tabs {
    display: flex;
    background: white;
    border-radius: 8px;
    padding: 8px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pcg-tab-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #005997;
}

.pcg-tab-label .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #005997;
}

/* Workflow Filter */
.pcg-workflow-filter-wrapper {
    flex: 1;
    min-width: 200px;
}

.pcg-workflow-filter {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.pcg-workflow-filter:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* My Tickets Toggle */
.pcg-my-tickets-toggle {
    display: flex;
    align-items: center;
}

.pcg-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    user-select: none;
}

.pcg-toggle-label input[type="checkbox"] {
    display: none;
}

.pcg-toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: #d1d5db;
    border-radius: 12px;
    transition: background 0.3s ease;
}

.pcg-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.pcg-toggle-label input:checked + .pcg-toggle-switch {
    background: #2563eb;
}

.pcg-toggle-label input:checked + .pcg-toggle-switch::after {
    transform: translateX(20px);
}

.pcg-toggle-text {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

/* Search Bar */
.pcg-search-bar {
    margin-bottom: 16px;
}

.pcg-search-wrapper {
    position: relative;
}

.pcg-search-wrapper .dashicons {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

#pcg-search-input {
    width: 100%;
    padding: 12px 12px 12px 42px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.2s ease;
}

#pcg-search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Search Suggestions */
.pcg-search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    max-height: 320px;
    overflow-y: auto;
    margin-top: 4px;
}

.pcg-suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s ease;
}

.pcg-suggestion-item:last-child {
    border-bottom: none;
}

.pcg-suggestion-item:hover,
.pcg-suggestion-item.active {
    background: #f3f4f6;
}

.pcg-suggestion-id {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    min-width: 50px;
}

.pcg-suggestion-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pcg-suggestion-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
    background: #e5e7eb;
    color: #4b5563;
}

/* Ticket List */
.pcg-ticket-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pcg-ticket-item {
    background: white;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.pcg-ticket-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.pcg-ticket-item.needs-reply {
    border-left-color: #ef4444;
}

.pcg-ticket-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.pcg-ticket-id {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
}

.pcg-ticket-status {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pcg-ticket-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #1f2937;
    line-height: 1.4;
}

.pcg-ticket-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.pcg-ticket-department,
.pcg-ticket-product {
    font-size: 12px;
    padding: 4px 8px;
    background: #f3f4f6;
    border-radius: 4px;
    color: #4b5563;
}

.pcg-ticket-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}

.pcg-ticket-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
}

.pcg-avatar-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.pcg-ticket-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #9ca3af;
}

.pcg-ticket-replies {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pcg-ticket-replies .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Empty State */
.pcg-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.pcg-empty-state .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.pcg-empty-state p {
    margin: 0;
    font-size: 15px;
}

/* Pagination */
.pcg-pagination-wrapper {
    margin-top: 20px;
}

.pcg-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.pcg-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pcg-page-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.pcg-page-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

.pcg-page-ellipsis {
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    color: #9ca3af;
}

/* Ticket Detail View */
.pcg-ticket-detail {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px;
}

.pcg-detail-header {
    margin-bottom: 20px;
}

.pcg-detail-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.pcg-detail-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.pcg-detail-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #111827;
}

.pcg-detail-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.pcg-detail-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pcg-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.pcg-author-info {
    display: flex;
    flex-direction: column;
}

.pcg-author-info strong {
    font-size: 15px;
}

.pcg-author-info span {
    font-size: 13px;
    color: #6b7280;
}

.pcg-detail-date {
    font-size: 13px;
    color: #6b7280;
}

.pcg-detail-assignee {
    margin-bottom: 16px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pcg-custom-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
}

.pcg-custom-field {
    font-size: 14px;
}

.pcg-custom-field strong {
    color: #4b5563;
    font-weight: 500;
    display: block;
    margin-bottom: 2px;
}

.pcg-detail-body {
    margin-bottom: 24px;
    font-size: 15px;
    line-height: 1.7;
    color: #374151;
}

.pcg-detail-body p {
    margin-bottom: 16px;
}

.pcg-detail-body p:last-child {
    margin-bottom: 0;
}

.pcg-detail-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    flex-wrap: wrap;
}

.pcg-status-change {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pcg-status-change label {
    font-size: 14px;
    font-weight: 500;
}

#pcg-status-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    min-width: 180px;
}

/* Attachments */
.pcg-attachments {
    margin: 16px 0;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
}

.pcg-attachments strong {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #374151;
}

.pcg-attachments strong .dashicons {
    color: #6b7280;
}

.pcg-attachments ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pcg-attachments li {
    margin: 0;
}

.pcg-attachments a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #005997;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.pcg-attachments a:hover {
    background: #f3f4f6;
    border-color: #005997;
}

.pcg-attachments a .dashicons {
    color: #6b7280;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.pcg-attachment-size {
    color: #9ca3af;
    font-size: 12px;
}

/* Replies */
.pcg-replies {
    margin-top: 32px;
    border-top: 2px solid #e5e7eb;
    padding-top: 24px;
}

.pcg-reply,
.pcg-reply-history,
.pcg-reply-note {
    margin-bottom: 20px;
    padding: 16px;
    border-radius: 10px;
    background: #f9fafb;
}

.pcg-reply-history {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
}

.pcg-reply-note {
    background: #fef2f2;
    border-left: 3px solid #ef4444;
}

.pcg-reply-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.pcg-reply-author {
    font-weight: 600;
    font-size: 14px;
}

.pcg-reply-date {
    font-size: 12px;
    color: #6b7280;
}

.pcg-reply-content {
    font-size: 14px;
    line-height: 1.6;
}

/* Reply Actions Buttons (Edit/Delete) */
.pcg-reply-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.pcg-reply-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.pcg-reply-actions-buttons {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.pcg-edit-reply-btn,
.pcg-delete-reply-btn {
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.pcg-edit-reply-btn:hover {
    background: #eff6ff;
    color: #2563eb;
}

.pcg-delete-reply-btn:hover {
    background: #fef2f2;
    color: #dc2626;
}

.pcg-edit-reply-btn .dashicons,
.pcg-delete-reply-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Attachment Delete Button */
.pcg-attachment-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pcg-delete-attachment-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.pcg-delete-attachment-btn:hover {
    background: #fef2f2;
    color: #dc2626;
}

.pcg-delete-attachment-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Edit Reply Form */
.pcg-edit-reply-form {
    margin-top: 8px;
}

.pcg-edit-reply-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    margin-bottom: 12px;
}

.pcg-edit-reply-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.pcg-edit-reply-buttons {
    display: flex;
    gap: 8px;
}

.pcg-edit-reply-buttons .pcg-btn {
    padding: 8px 16px;
    font-size: 13px;
}

.pcg-edit-reply-buttons .pcg-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.pcg-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.pcg-btn-secondary:hover {
    background: #e5e7eb;
}

/* Reply Form */
.pcg-reply-form-container {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #e5e7eb;
}

.pcg-reply-form-container h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
}

#pcg-reply-content {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 12px;
}

#pcg-reply-content:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.pcg-reply-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.pcg-reply-close-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
}

/* File Upload Section */
.pcg-file-upload-section {
    margin-bottom: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 2px dashed #d1d5db;
}

.pcg-file-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #005997;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.pcg-file-upload-label:hover {
    background: #004a7d;
}

.pcg-file-upload-label input[type="file"] {
    display: none;
}

.pcg-file-upload-label .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.pcg-upload-hint {
    font-size: 12px;
    color: #6b7280;
    margin: 10px 0 0 0;
}

.pcg-file-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pcg-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
}

.pcg-file-item .dashicons {
    color: #6b7280;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.pcg-file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #374151;
}

.pcg-file-size {
    color: #9ca3af;
    font-size: 12px;
}

.pcg-remove-file {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.pcg-remove-file:hover {
    background: #fef2f2;
    color: #dc2626;
}

.pcg-remove-file .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Upload buttons wrapper */
.pcg-upload-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

/* Dropbox button */
.pcg-dropbox-btn {
    background: #0061fe !important;
}

.pcg-dropbox-btn:hover {
    background: #004fc4 !important;
}

/* Dropbox upload status */
.pcg-file-uploading {
    border-color: #0061fe;
    background: #eff6ff;
}

.pcg-file-uploading .dashicons {
    color: #0061fe;
}

.pcg-file-uploaded {
    border-color: #22c55e;
    background: #f0fdf4;
}

.pcg-file-uploaded .dashicons {
    color: #22c55e;
}

.pcg-file-error {
    border-color: #ef4444;
    background: #fef2f2;
}

.pcg-file-error .dashicons {
    color: #ef4444;
}

.pcg-file-status {
    font-size: 12px;
    color: #6b7280;
    margin-left: auto;
}

/* Loading Overlay */
.pcg-loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.pcg-portal.loading .pcg-loading-overlay {
    display: flex;
}

.pcg-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .pcg-header {
        padding: 10px 12px;
    }
    
    .pcg-header-content {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .pcg-logo-area {
        align-items: center;
        text-align: center;
    }
    
    .pcg-user-menu {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .pcg-user-name {
        width: 100%;
        text-align: center;
        margin-bottom: 4px;
    }
    
    .pcg-filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .pcg-status-tabs {
        justify-content: center;
    }
    
    .pcg-workflow-filter-wrapper {
        width: 100%;
    }
    
    .pcg-my-tickets-toggle {
        width: 100%;
    }
    
    .pcg-toggle-label {
        width: 100%;
        justify-content: center;
    }
    
    /* Mobile search suggestions - simplified layout */
    .pcg-suggestion-item {
        flex-wrap: nowrap;
        padding: 10px 12px;
    }
    
    .pcg-suggestion-id {
        font-size: 11px;
        min-width: 50px;
        max-width: 50px;
        flex-shrink: 0;
    }
    
    .pcg-suggestion-title {
        flex: 1;
        min-width: 0;
        font-size: 14px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .pcg-suggestion-status {
        display: none !important;
    }
    
    /* Make search suggestions full width on mobile */
    .pcg-search-suggestions {
        left: -16px;
        right: -16px;
        width: calc(100% + 32px);
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .pcg-detail-meta {
        flex-direction: column;
    }
    
    .pcg-detail-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .pcg-status-change {
        flex-direction: column;
        align-items: stretch;
    }
    
    #pcg-status-select {
        width: 100%;
    }
    
    .pcg-reply-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .pcg-upload-buttons {
        flex-direction: column;
    }
    
    .pcg-file-upload-label,
    .pcg-dropbox-btn {
        justify-content: center;
    }
    
    /* Mobile: Reply edit/delete buttons */
    .pcg-reply-header {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .pcg-reply-header-left {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .pcg-reply-actions-buttons {
        margin-left: auto;
    }
    
    .pcg-edit-reply-btn,
    .pcg-delete-reply-btn {
        padding: 6px 10px;
        background: #f3f4f6;
        border-radius: 6px;
    }
    
    /* Mobile: Attachment delete button */
    .pcg-attachment-item {
        flex-wrap: nowrap;
    }
    
    .pcg-attachments a {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }
    
    .pcg-attachments a span:not(.dashicons) {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .pcg-delete-attachment-btn {
        padding: 6px 10px;
        background: #f3f4f6;
        border-radius: 6px;
    }
}

/* Print Styles */
@media print {
    .pcg-header,
    .pcg-filters-bar,
    .pcg-search-bar,
    .pcg-reply-form-container,
    .pcg-detail-actions {
        display: none !important;
    }
    
    .pcg-portal {
        background: white;
    }
    
    .pcg-ticket-detail {
        padding: 0;
    }
    
    .pcg-detail-content {
        box-shadow: none;
        padding: 0;
    }
}

/* ========================================
   LOGIN FORM STYLES
   ======================================== */

.pcg-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #005997 0%, #003d66 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.pcg-login-container {
    width: 100%;
    max-width: 400px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
}

.pcg-login-header {
    text-align: center;
    margin-bottom: 32px;
}

.pcg-login-logo {
    width: 70px;
    height: 70px;
    background: #005997;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.pcg-login-logo-custom {
    width: auto;
    height: auto;
    max-width: 200px;
    background: none;
    border-radius: 0;
}

.pcg-login-logo-custom img {
    max-width: 100%;
    max-height: 80px;
    width: auto;
    height: auto;
}

.pcg-login-logo .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: white;
}

.pcg-login-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #1f2937;
}

.pcg-login-header p {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.pcg-login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pcg-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pcg-form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.pcg-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.pcg-input-wrapper > .dashicons:first-child {
    position: absolute;
    left: 12px;
    color: #9ca3af;
    font-size: 18px;
    width: 18px;
    height: 18px;
    z-index: 1;
}

.pcg-input-wrapper input {
    width: 100%;
    padding: 12px 12px 12px 42px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.pcg-password-wrapper input {
    padding-right: 44px;
}

.pcg-input-wrapper input:focus {
    outline: none;
    border-color: #005997;
    box-shadow: 0 0 0 3px rgba(0, 89, 151, 0.1);
}

.pcg-toggle-password {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.pcg-toggle-password:hover {
    color: #6b7280;
    background: #f3f4f6;
}

.pcg-toggle-password .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.pcg-form-checkbox {
    flex-direction: row;
    align-items: center;
}

.pcg-form-checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400;
}

.pcg-form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #005997;
}

.pcg-form-message {
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
}

.pcg-message-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.pcg-message-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.pcg-btn-block {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 16px;
    background: #005997;
}

.pcg-btn-block:hover {
    background: #004a7d;
}

.pcg-btn-text {
    display: inline;
}

.pcg-btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pcg-spinner-small {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.pcg-login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.pcg-login-footer p {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
}

@media (max-width: 480px) {
    .pcg-login-container {
        padding: 24px;
    }
    
    .pcg-login-logo {
        width: 60px;
        height: 60px;
    }
    
    .pcg-login-logo .dashicons {
        font-size: 28px;
        width: 28px;
        height: 28px;
    }
    
    .pcg-login-header h1 {
        font-size: 20px;
    }
}
