/* =========================
 BASE STYLES
========================= */
.iqg-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.iqg-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.iqg-header h2 {
    color: #2c3e50;
    font-size: 32px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.iqg-header h2 .dashicons {
    color: #3498db;
    font-size: 32px;
    width: 32px;
    height: 32px;
}

.iqg-header .subtitle {
    color: #7f8c8d;
    font-size: 16px;
    margin: 0;
}

/* =========================
 INPUT SECTIONS
========================= */
.iqg-input-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .iqg-input-container {
        grid-template-columns: 1fr;
    }
}

.input-section {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.input-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.input-section label {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-section label .dashicons {
    color: #3498db;
}

.input-section .hint {
    font-size: 13px;
    font-weight: normal;
    color: #7f8c8d;
    margin-left: auto;
}

.input-section textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    background: #fdfdfd;
}

.input-section textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.char-counter {
    text-align: right;
    font-size: 14px;
    color: #95a5a6;
    margin-top: 8px;
}

/* =========================
 CATEGORIES SECTION
========================= */
.iqg-categories-section {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #9b59b6;
}

.iqg-categories-section h3 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
}

.section-description {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 20px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.category-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-option:hover {
    border-color: #3498db;
    background: #f0f7ff;
}

.category-option input[type="checkbox"] {
    margin-top: 3px;
    min-width: 18px;
    height: 18px;
}

.category-option label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    margin: 0;
    font-weight: normal;
}

.category-option label .dashicons {
    color: #3498db;
    font-size: 20px;
    margin-bottom: 5px;
}

.category-option label strong {
    color: #2c3e50;
    font-size: 16px;
}

.category-option label span {
    color: #7f8c8d;
    font-size: 13px;
    line-height: 1.4;
}

/* =========================
 OPTIONS SECTION
========================= */
.iqg-options-section {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #f39c12;
}

.iqg-options-section h3 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-group label {
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.option-group select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    max-width: 300px;
}

.option-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
}

.option-hint {
    font-size: 13px;
    color: #7f8c8d;
    margin-left: 5px;
}

/* =========================
 ACTION BUTTONS
========================= */
.iqg-actions {
    margin: 30px 0;
}

.iqg-generate-btn {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 18px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.iqg-generate-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2980b9, #1c638e);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(52, 152, 219, 0.2);
}

.iqg-generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* =========================
 LOADING STATE
========================= */
.iqg-loading {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 10px;
    margin: 30px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.iqg-loading p {
    color: #2c3e50;
    margin: 10px 0;
}

.iqg-loading .loading-details {
    color: #7f8c8d;
    font-size: 14px;
    font-style: italic;
}

/* =========================
 ERROR MESSAGES
========================= */
.iqg-error {
    background: #ffeaea;
    border-left: 4px solid #e74c3c;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    display: none;
}

.error-content {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #c0392b;
}

/* =========================
 RESULTS SECTION
========================= */
.iqg-results {
    animation: fadeIn 0.8s ease;
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.results-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.results-header h3 {
    color: #2c3e50;
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
}

/* Summary */
.iqg-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #3498db;
}

.iqg-summary p {
    margin: 0;
    color: #2c3e50;
    line-height: 1.6;
}

/* Question Cards */
.iqg-questions-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

.iqg-question-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.iqg-question-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.iqg-question-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.iqg-question-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.iqg-question-number {
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
}

.iqg-category-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.iqg-category-badge.category-technical {
    background: #e3f2fd;
    color: #1976d2;
}

.iqg-category-badge.category-behavioral {
    background: #f3e5f5;
    color: #7b1fa2;
}

.iqg-category-badge.category-situational {
    background: #fff3e0;
    color: #f57c00;
}

.iqg-category-badge.category-culture {
    background: #e8f5e9;
    color: #388e3c;
}

.iqg-copy-btn {
    padding: 8px 16px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.iqg-copy-btn:hover:not(:disabled) {
    background: #2980b9;
}

/* Question Content */
.iqg-question-content {
    padding: 25px;
}

.iqg-question-text {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 4px solid #3498db;
    font-size: 16px;
    line-height: 1.6;
    color: #2c3e50;
}

.iqg-answer-section {
    margin: 25px 0;
}

.iqg-answer-section h5,
.iqg-explanation-section h5 {
    color: #2c3e50;
    font-size: 16px;
    margin-top: 0;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.iqg-answer-section pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #34495e;
    background: #fdfdfd;
    padding: 20px;
    border-radius: 5px;
    border: 1px solid #eee;
}

.iqg-explanation-section {
    background: #fff9e6;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #f39c12;
    margin-top: 20px;
}

.iqg-explanation-section p {
    margin: 0;
    color: #34495e;
    line-height: 1.6;
    font-size: 15px;
}

/* Download Section */
.iqg-download-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
    text-align: center;
}

.iqg-download-btn {
    background: linear-gradient(135deg, #27ae60, #219653);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.iqg-download-btn:hover {
    background: linear-gradient(135deg, #219653, #1e8449);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(39, 174, 96, 0.2);
}

/* =========================
 RESPONSIVE DESIGN
========================= */
@media (max-width: 768px) {
    .iqg-wrapper {
        padding: 20px;
    }
    
    .iqg-header h2 {
        font-size: 24px;
        flex-direction: column;
        gap: 5px;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .iqg-question-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .iqg-copy-btn {
        width: 100%;
        justify-content: center;
    }
    
    .iqg-question-content {
        padding: 15px;
    }
    
    .iqg-answer-section pre {
        font-size: 13px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .iqg-header h2 {
        font-size: 22px;
    }
    
    .input-section {
        padding: 20px;
    }
    
    .iqg-copy-btn,
    .iqg-download-btn {
        padding: 10px 15px;
        font-size: 14px;
        width: 100%;
    }
}