/* Freshdesk Customer Portal - Professional Styles */

:root {
    --fcp-primary: #2196F3;
    --fcp-primary-dark: #1976D2;
    --fcp-primary-light: #BBDEFB;
    --fcp-text: #333333;
    --fcp-text-light: #666666;
    --fcp-text-muted: #999999;
    --fcp-bg: #f5f7fa;
    --fcp-white: #ffffff;
    --fcp-border: #e0e0e0;
    --fcp-success: #4CAF50;
    --fcp-warning: #FF9800;
    --fcp-error: #f44336;
    --fcp-radius: 12px;
    --fcp-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --fcp-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
}

/* Base */
.fcp-portal {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--fcp-text);
    -webkit-font-smoothing: antialiased;
}

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

/* ==================== LOGIN SCREEN ==================== */

.fcp-login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--fcp-bg) 0%, #e8eef5 100%);
    border-radius: var(--fcp-radius);
}

.fcp-login-box {
    width: 100%;
    max-width: 420px;
    background: var(--fcp-white);
    border-radius: var(--fcp-radius);
    box-shadow: var(--fcp-shadow-lg);
    padding: 40px;
}

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

.fcp-login-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--fcp-primary) 0%, var(--fcp-primary-dark) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.fcp-login-icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

.fcp-login-header h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 700;
    color: var(--fcp-text);
}

.fcp-login-header p {
    margin: 0;
    color: var(--fcp-text-muted);
    font-size: 14px;
}

.fcp-code-info {
    background: var(--fcp-primary-light);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--fcp-primary-dark);
}

.fcp-code-info strong {
    display: block;
    margin-top: 4px;
    word-break: break-all;
}

.fcp-login-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

.fcp-login-message.success {
    display: block;
    background: #E8F5E9;
    color: #2E7D32;
}

.fcp-login-message.error {
    display: block;
    background: #FFEBEE;
    color: #C62828;
}

/* ==================== FORM ELEMENTS ==================== */

.fcp-form-group {
    margin-bottom: 20px;
}

.fcp-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--fcp-text);
}

.fcp-form-group input[type="text"],
.fcp-form-group input[type="email"],
.fcp-form-group input[type="password"],
.fcp-form-group select,
.fcp-form-group textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 2px solid var(--fcp-border);
    border-radius: 10px;
    background: var(--fcp-white);
    transition: all 0.2s ease;
    outline: none;
}

.fcp-form-group input:focus,
.fcp-form-group select:focus,
.fcp-form-group textarea:focus {
    border-color: var(--fcp-primary);
    box-shadow: 0 0 0 4px var(--fcp-primary-light);
}

.fcp-form-group input::placeholder {
    color: var(--fcp-text-muted);
}

/* Code Input Special Styling */
#fcp-code {
    font-size: 24px;
    letter-spacing: 8px;
    text-align: center;
    font-weight: 600;
}

/* ==================== BUTTONS ==================== */

.fcp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

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

.fcp-btn-primary {
    background: linear-gradient(135deg, var(--fcp-primary) 0%, var(--fcp-primary-dark) 100%);
    color: white;
}

.fcp-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.fcp-btn-secondary {
    background: var(--fcp-bg);
    color: var(--fcp-text);
    border: 2px solid var(--fcp-border);
}

.fcp-btn-secondary:hover:not(:disabled) {
    background: var(--fcp-border);
}

.fcp-btn-link {
    background: none;
    color: var(--fcp-primary);
    padding: 8px 0;
}

.fcp-btn-link:hover {
    color: var(--fcp-primary-dark);
}

.fcp-btn-block {
    width: 100%;
}

.fcp-btn-sm {
    padding: 10px 16px;
    font-size: 13px;
}

/* ==================== MAIN PORTAL ==================== */

.fcp-main {
    background: var(--fcp-white);
    border-radius: var(--fcp-radius);
    box-shadow: var(--fcp-shadow);
    overflow: hidden;
}

/* Header */
.fcp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    background: linear-gradient(135deg, var(--fcp-primary) 0%, var(--fcp-primary-dark) 100%);
    color: white;
}

.fcp-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.fcp-user-email {
    display: block;
    font-size: 13px;
    opacity: 0.85;
    margin-top: 4px;
}

.fcp-header .fcp-btn-secondary {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
    color: white;
}

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

/* Tabs */
.fcp-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--fcp-border);
    padding: 0 28px;
    background: var(--fcp-bg);
}

.fcp-tab {
    padding: 16px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--fcp-text-light);
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.fcp-tab:hover {
    color: var(--fcp-primary);
}

.fcp-tab.active {
    color: var(--fcp-primary);
}

.fcp-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--fcp-primary);
    border-radius: 3px 3px 0 0;
}

/* Tab Content */
.fcp-tab-content {
    display: none;
    padding: 28px;
}

.fcp-tab-content.active {
    display: block;
}

/* ==================== TICKET LIST ==================== */

.fcp-ticket-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fcp-ticket-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 20px;
    background: var(--fcp-bg);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.fcp-ticket-item:hover {
    border-color: var(--fcp-primary);
    transform: translateX(4px);
}

.fcp-ticket-info h4 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--fcp-text);
}

.fcp-ticket-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--fcp-text-muted);
}

.fcp-ticket-id {
    font-family: monospace;
    background: var(--fcp-white);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Status Badge */
.fcp-status {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.fcp-status-2 { background: var(--fcp-primary); color: white; }
.fcp-status-3 { background: var(--fcp-warning); color: white; }
.fcp-status-4 { background: var(--fcp-success); color: white; }
.fcp-status-5 { background: #9E9E9E; color: white; }
.fcp-status-6 { background: #9C27B0; color: white; }

/* Priority Indicator */
.fcp-priority {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.fcp-priority-1 { background: var(--fcp-success); }
.fcp-priority-2 { background: var(--fcp-primary); }
.fcp-priority-3 { background: var(--fcp-warning); }
.fcp-priority-4 { background: var(--fcp-error); }

/* Empty State */
.fcp-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--fcp-text-muted);
}

.fcp-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.fcp-empty h3 {
    margin: 0 0 8px;
    color: var(--fcp-text-light);
}

/* ==================== TICKET DETAIL ==================== */

.fcp-ticket-detail {
    padding: 28px;
}

.fcp-back-btn {
    background: none;
    border: none;
    color: var(--fcp-text-light);
    font-size: 14px;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 20px;
    transition: color 0.2s;
}

.fcp-back-btn:hover {
    color: var(--fcp-primary);
}

.fcp-detail-header {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--fcp-border);
}

.fcp-detail-header h3 {
    margin: 0 0 12px;
    font-size: 20px;
    color: var(--fcp-text);
}

.fcp-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    color: var(--fcp-text-muted);
}

.fcp-detail-meta strong {
    color: var(--fcp-text);
}

/* Original Description */
.fcp-original {
    background: var(--fcp-bg);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 28px;
}

.fcp-original h4 {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--fcp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fcp-original-body {
    color: var(--fcp-text);
    line-height: 1.7;
}

/* Conversations */
.fcp-conversations h4 {
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--fcp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fcp-conversation {
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 12px;
}

.fcp-conversation.incoming {
    background: var(--fcp-primary-light);
    border-left: 4px solid var(--fcp-primary);
}

.fcp-conversation.outgoing {
    background: var(--fcp-bg);
    border-left: 4px solid var(--fcp-border);
}

.fcp-conversation-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
}

.fcp-conversation-from {
    font-weight: 600;
    color: var(--fcp-text);
}

.fcp-conversation-date {
    color: var(--fcp-text-muted);
}

.fcp-conversation-body {
    color: var(--fcp-text);
    line-height: 1.6;
}

/* Reply Form */
.fcp-reply-form {
    background: var(--fcp-bg);
    padding: 24px;
    border-radius: 10px;
    margin-top: 28px;
}

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

.fcp-reply-form textarea {
    margin-bottom: 16px;
}

/* ==================== LOADING ==================== */

.fcp-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--fcp-text-muted);
}

.fcp-loading::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid var(--fcp-border);
    border-top-color: var(--fcp-primary);
    border-radius: 50%;
    animation: fcp-spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

/* ==================== MESSAGES ==================== */

.fcp-message {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.fcp-message-success {
    background: #E8F5E9;
    color: #2E7D32;
}

.fcp-message-error {
    background: #FFEBEE;
    color: #C62828;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 640px) {
    .fcp-login-box {
        padding: 28px 20px;
    }
    
    .fcp-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .fcp-tabs {
        padding: 0 16px;
    }
    
    .fcp-tab {
        padding: 14px 16px;
        font-size: 13px;
    }
    
    .fcp-tab-content {
        padding: 20px 16px;
    }
    
    .fcp-ticket-item {
        grid-template-columns: 1fr;
    }
    
    .fcp-ticket-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .fcp-detail-meta {
        flex-direction: column;
        gap: 12px;
    }
}

/* ==================== NEW TICKET FORM ==================== */

.fcp-ticket-form {
    max-width: 600px;
}

.fcp-ticket-form textarea {
    min-height: 150px;
    resize: vertical;
}
