/* =========================
   BASE STYLES & VARIABLES
========================= */
:root {
    --primary-color: #4299e1;
    --primary-dark: #3182ce;
    --secondary-color: #38b2ac;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --danger-color: #f56565;
    --light-color: #f7fafc;
    --dark-color: #2d3748;
    --text-color: #4a5568;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --radius: 10px;
    --radius-sm: 6px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.aclp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
}

/* =========================
   TYPOGRAPHY
========================= */
.aclp-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.aclp-subtitle {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 20px;
}

.aclp-card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.aclp-label {
    display: block;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* =========================
   HERO SECTION
========================= */
.aclp-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: var(--radius);
    padding: 50px 40px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.aclp-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.1;
}

.aclp-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.aclp-features {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 25px;
}

.aclp-feature {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.aclp-feature:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
}

/* =========================
   CARDS
========================= */
.aclp-card {
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.aclp-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* =========================
   FORM STYLES
========================= */
.aclp-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.aclp-form-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.aclp-input, .aclp-textarea, .aclp-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: all 0.3s;
    background: white;
}

.aclp-input:focus, .aclp-textarea:focus, .aclp-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.aclp-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

.aclp-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%234a5568' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.aclp-select-small {
    padding: 10px 14px;
    font-size: 0.9rem;
}

.aclp-hint {
    font-size: 0.85rem;
    color: #718096;
    margin-top: 6px;
    font-style: italic;
}

.aclp-char-count {
    text-align: right;
    font-size: 0.8rem;
    color: #a0aec0;
    margin-top: 5px;
}

/* =========================
   OPTIONS GRID
========================= */
.aclp-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.aclp-option-group {
    padding: 20px;
    background: var(--light-color);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary-color);
}

.aclp-option-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 8px;
}

.aclp-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.aclp-option-text {
    font-weight: 600;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.aclp-option-desc {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-left: 32px;
    margin-top: 5px;
}

/* =========================
   BUTTONS
========================= */
.aclp-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 40px 0;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.aclp-btn {
    padding: 16px 30px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    border: none;
    justify-content: center;
    min-width: 200px;
}

.aclp-btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.aclp-btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(66, 153, 225, 0.3);
}

.aclp-btn-secondary {
    background: white;
    color: var(--dark-color);
    border: 2px solid var(--border-color);
}

.aclp-btn-secondary:hover {
    background: var(--light-color);
    border-color: var(--primary-color);
    transform: translateY(-3px);
}

.aclp-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.aclp-btn-small {
    padding: 10px 20px;
    font-size: 0.9rem;
    min-width: auto;
}

.aclp-btn-download {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.aclp-btn-print {
    background: var(--light-color);
    color: var(--dark-color);
    border: 2px solid var(--border-color);
}

.aclp-btn-copy {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
    color: white;
}

.aclp-btn-download:hover,
.aclp-btn-print:hover,
.aclp-btn-copy:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* =========================
   LOADING STATE
========================= */
.aclp-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.aclp-loading-content {
    text-align: center;
    max-width: 500px;
    padding: 40px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.aclp-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--light-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 25px;
    animation: aclp-spin 1s linear infinite;
}

@keyframes aclp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.aclp-loading-content h3 {
    color: var(--dark-color);
    margin-bottom: 10px;
}

.aclp-loading-content p {
    color: var(--text-color);
    margin-bottom: 25px;
}

.aclp-progress {
    width: 100%;
}

.aclp-progress-bar {
    height: 8px;
    background: var(--light-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.aclp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s;
}

.aclp-progress-text {
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 600;
}

/* =========================
   ERROR MESSAGE
========================= */
.aclp-error {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    border-left: 5px solid var(--danger-color);
    padding: 20px;
    border-radius: var(--radius-sm);
    margin: 20px 0;
    display: none;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.aclp-error-content {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    position: relative;
}

.aclp-error-content h4 {
    color: #742a2a;
    margin-bottom: 5px;
}

.aclp-error-content p {
    color: #9b2c2c;
    margin: 0;
}

.aclp-error-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9b2c2c;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    line-height: 1;
}

.aclp-error-close:hover {
    color: #742a2a;
}

/* =========================
   RESULTS SECTION
========================= */
.aclp-results {
    animation: slideIn 0.5s ease;
}

.aclp-results-header {
    background: linear-gradient(135deg, var(--success-color), #38a169);
    color: white;
    padding: 40px;
    border-radius: var(--radius) var(--radius) 0 0;
    text-align: center;
    margin-bottom: 0;
}

.aclp-results-title {
    color: white;
    font-size: 2rem;
    margin-bottom: 10px;
}

.aclp-results-subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
}

/* Tabs */
.aclp-tabs-container {
    display: flex;
    gap: 10px;
    padding: 20px 40px;
    background: var(--light-color);
    border-bottom: 1px solid var(--border-color);
}

.aclp-tab {
    padding: 12px 24px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    border-bottom: none;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s;
}

.aclp-tab:hover {
    background: #edf2f7;
}

.aclp-tab.active {
    background: white;
    color: var(--primary-color);
    border-color: var(--primary-color);
    position: relative;
    bottom: -1px;
}

/* Letter Content */
.aclp-letter-content {
    background: white;
    padding: 40px;
    border-radius: 0 0 var(--radius) var(--radius);
    border: 1px solid var(--border-color);
    border-top: none;
}

.aclp-letter-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.aclp-letter-header h3 {
    color: var(--dark-color);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.aclp-letter-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--text-color);
}

.aclp-letter-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.aclp-letter-body {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--dark-color);
    margin-bottom: 30px;
}

.aclp-letter-body p {
    margin-bottom: 20px;
}

.aclp-bullet-list {
    margin: 15px 0 15px 20px;
}

.aclp-bullet-list li {
    margin-bottom: 8px;
    padding-left: 5px;
}

/* Email Section */
.aclp-email-section {
    background: #f0f7ff;
    padding: 25px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary-color);
    margin: 30px 0;
}

.aclp-email-section h4 {
    color: var(--dark-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.aclp-email-subject {
    background: white;
    padding: 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
}

.aclp-email-body {
    background: white;
    padding: 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    line-height: 1.6;
}

/* Letter Actions */
.aclp-letter-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Results Actions */
.aclp-results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    padding: 30px;
    background: var(--light-color);
    border-radius: 0 0 var(--radius) var(--radius);
    border: 1px solid var(--border-color);
    border-top: none;
}

/* =========================
   ICONS
========================= */
.aclp-icon {
    font-size: 1.2em;
    vertical-align: middle;
}

.aclp-icon-document::before { content: "📄"; }
.aclp-icon-check::before { content: "✅"; }
.aclp-icon-edit::before { content: "✏️"; }
.aclp-icon-user::before { content: "👤"; }
.aclp-icon-email::before { content: "📧"; }
.aclp-icon-phone::before { content: "📱"; }
.aclp-icon-location::before { content: "📍"; }
.aclp-icon-briefcase::before { content: "💼"; }
.aclp-icon-company::before { content: "🏢"; }
.aclp-icon-hiring::before { content: "🤝"; }
.aclp-icon-link::before { content: "🔗"; }
.aclp-icon-cv::before { content: "📋"; }
.aclp-icon-job::before { content: "📝"; }
.aclp-icon-skills::before { content: "🛠️"; }
.aclp-icon-experience::before { content: "📅"; }
.aclp-icon-education::before { content: "🎓"; }
.aclp-icon-tone::before { content: "🎭"; }
.aclp-icon-settings::before { content: "⚙️"; }
.aclp-icon-list::before { content: "📋"; }
.aclp-icon-keyword::before { content: "🔑"; }
.aclp-icon-generate::before { content: "🚀"; }
.aclp-icon-reset::before { content: "🔄"; }
.aclp-icon-error::before { content: "❌"; }
.aclp-icon-success::before { content: "✅"; }
.aclp-icon-download::before { content: "⬇️"; }
.aclp-icon-print::before { content: "🖨️"; }
.aclp-icon-copy::before { content: "📋"; }

/* =========================
   RESPONSIVE DESIGN
========================= */
@media (max-width: 768px) {
    .aclp-container {
        padding: 15px;
    }
    
    .aclp-title {
        font-size: 2rem;
    }
    
    .aclp-hero {
        padding: 30px 20px;
    }
    
    .aclp-card {
        padding: 20px;
    }
    
    .aclp-form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .aclp-options-grid {
        grid-template-columns: 1fr;
    }
    
    .aclp-actions {
        flex-direction: column;
    }
    
    .aclp-btn {
        width: 100%;
        min-width: auto;
    }
    
    .aclp-results-actions {
        flex-direction: column;
    }
    
    .aclp-tabs-container {
        flex-direction: column;
        padding: 15px;
    }
    
    .aclp-tab {
        width: 100%;
        text-align: center;
    }
    
    .aclp-features {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .aclp-feature {
        width: 100%;
        justify-content: center;
    }
    
    .aclp-letter-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .aclp-title {
        font-size: 1.7rem;
    }
    
    .aclp-results-title {
        font-size: 1.5rem;
    }
    
    .aclp-card-title {
        font-size: 1.3rem;
    }
    
    .aclp-letter-meta {
        flex-direction: column;
        gap: 10px;
    }
}

/* Print Styles */
@media print {
    .aclp-hero,
    .aclp-actions,
    .aclp-results-actions,
    .aclp-tabs-container,
    .aclp-loading,
    .aclp-error {
        display: none !important;
    }
    
    .aclp-container {
        padding: 0;
    }
    
    .aclp-card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    .aclp-letter-content {
        padding: 20px 0;
    }
}