/* WordPress AI Letter Writer Styles */
.alwp-container {
    font-family: 'Inter', sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Simulation Bar */
.alwp-sim-bar {
    background: #2c3338;
    color: white;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 20px;
    border-radius: 4px;
    display: none;
}

.alwp-sim-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.alwp-sim-left i {
    font-size: 18px;
    color: #787c82;
}

.alwp-sim-divider {
    height: 16px;
    width: 1px;
    background: #40464d;
}

.alwp-sim-buttons {
    display: flex;
    gap: 4px;
}

.alwp-btn-sim {
    padding: 4px 12px;
    border: none;
    border-radius: 4px;
    background: #3c434a;
    color: #d1d5db;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 12px;
}

.alwp-btn-sim.active {
    background: #2271b1;
    color: white;
}

/* Header */
.alwp-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 30;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 24px;
}

.alwp-header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.alwp-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.alwp-logo-icon {
    background: #4f46e5;
    padding: 8px;
    border-radius: 8px;
    color: white;
}

.alwp-logo-icon i {
    font-size: 20px;
}

.alwp-logo h1 {
    font-size: 20px;
    font-weight: bold;
    background: linear-gradient(to right, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.alwp-logo span {
    color: #94a3b8;
    font-weight: 500;
}

.alwp-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.alwp-history-btn, .alwp-reset-btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    border-radius: 6px;
}

.alwp-history-btn {
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.alwp-history-btn:hover {
    color: #4f46e5;
    background: #eef2ff;
    border-color: #c7d2fe;
}

.alwp-reset-btn {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.alwp-reset-btn:hover {
    color: #b91c1c;
    background: #fee2e2;
    border-color: #fca5a5;
}

.alwp-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
}

.alwp-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Shortcode Indicator */
.alwp-shortcode-indicator {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #4f46e5;
    margin-bottom: 24px;
    display: none;
}

/* Templates */
.alwp-templates {
    margin-bottom: 32px;
}

.alwp-templates h2 {
    font-size: 14px;
    font-weight: bold;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.alwp-templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.alwp-template-card {
    padding: 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s;
}

.alwp-template-card:hover {
    border-color: #a5b4fc;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.alwp-template-card.active {
    border-color: #4f46e5;
    background: #eef2ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px -2px rgba(79, 70, 229, 0.2);
}

.alwp-template-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #eef2ff;
    color: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    transition: all 0.3s;
}

.alwp-template-card:hover .alwp-template-icon {
    background: #4f46e5;
    color: white;
}

.alwp-template-card h3 {
    font-size: 14px;
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 4px;
}

.alwp-template-card p {
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
}

/* Main Content */
.alwp-main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

@media (min-width: 1024px) {
    .alwp-main-grid {
        grid-template-columns: 1fr 2fr;
    }
}

/* Form */
.alwp-form-column {
    background: white;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.alwp-form-group {
    margin-bottom: 20px;
}

.alwp-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.alwp-form-group input,
.alwp-form-group select,
.alwp-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.alwp-form-group input:focus,
.alwp-form-group select:focus,
.alwp-form-group textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.alwp-generate-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(to right, #4f46e5, #7c3aed);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.alwp-generate-btn:hover {
    background: linear-gradient(to right, #4338ca, #6d28d9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.alwp-generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Preview */
.alwp-preview-column {
    background: white;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.alwp-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.alwp-preview-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.alwp-preview-actions {
    display: flex;
    gap: 8px;
}

.alwp-copy-btn {
    padding: 8px 16px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.alwp-copy-btn:hover {
    background: #0da271;
}

.alwp-copy-btn.copied {
    background: #059669;
}

.alwp-copy-btn.copied i::before {
    content: "\f00c"; /* fa-check icon */
}

.alwp-print-btn {
    padding: 8px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.alwp-print-btn:hover {
    background: #2563eb;
}

.alwp-download-btn {
    padding: 8px 16px;
    background: #8b5cf6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.alwp-download-btn:hover {
    background: #7c3aed;
}

.alwp-letter-preview {
    min-height: 400px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 32px;
    background-image: linear-gradient(#e5e7eb 1px, transparent 1px);
    background-size: 100% 2.5rem;
}

.alwp-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: #9ca3af;
}

.alwp-empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
}

/* Result */
.alwp-result {
    background: white;
}

.alwp-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.alwp-result-header h4 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.alwp-letter-date {
    font-size: 14px;
    color: #6b7280;
}

.alwp-letter-content {
    font-size: 16px;
    line-height: 1.8;
    color: #374151;
    white-space: pre-line;
}

.alwp-letter-content br {
    content: "";
    display: block;
    margin-bottom: 1rem;
}

/* Loading Overlay */
.alwp-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.alwp-loading-content {
    background: white;
    padding: 32px;
    border-radius: 12px;
    text-align: center;
}

.alwp-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
.alwp-footer {
    text-align: center;
    padding: 32px 0;
    color: #94a3b8;
    font-size: 14px;
    margin-top: 32px;
    border-top: 1px solid #e5e7eb;
}

/* Responsive */
@media (max-width: 768px) {
    .alwp-templates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .alwp-header-content {
        flex-direction: column;
        height: auto;
        padding: 16px 0;
    }
    
    .alwp-logo {
        margin-bottom: 16px;
    }
    
    .alwp-preview-actions {
        flex-wrap: wrap;
    }
    
    .alwp-header-actions {
        width: 100%;
        justify-content: center;
        margin-top: 16px;
    }
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }
    
    #alwp-app * {
        visibility: hidden;
    }
    
    #alwp-result,
    #alwp-result * {
        visibility: visible;
    }
    
    #alwp-result {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: none;
        padding: 20mm;
        background: white;
        box-shadow: none;
        border: none;
    }
    
    .alwp-result-header,
    .alwp-letter-content {
        page-break-inside: avoid;
    }
    
    .alwp-letter-content {
        font-size: 12pt !important;
        line-height: 1.6 !important;
    }
    
    /* Remove all non-printable elements */
    .alwp-header,
    .alwp-footer,
    .alwp-form-column,
    .alwp-templates,
    .alwp-sim-bar,
    .alwp-shortcode-indicator,
    .alwp-preview-header,
    .alwp-preview-actions,
    .no-print {
        display: none !important;
    }
}