/* =========================
 BASE STYLES & RESETS
========================= */
.aip-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    color: #333;
}

.aip-header {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.aip-header h1 {
    font-size: 2.8rem;
    color: #2c3e50;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.aip-subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Steps Indicator */
.aip-steps {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 30px;
}

.aip-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.aip-step.active {
    opacity: 1;
}

.aip-step-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.aip-step-text {
    font-weight: 600;
    color: #2c3e50;
}

/* Goals Section */
.aip-goals-section {
    background: white;
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.aip-goals-section h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.aip-section-description {
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Goal Cards */
.aip-goal-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 25px;
    transition: all 0.3s ease;
    position: relative;
}

.aip-goal-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.aip-goal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.aip-goal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.4rem;
}

.aip-remove-goal {
    background: #e74c3c;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.aip-remove-goal:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* Form Fields */
.aip-goal-fields {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.aip-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

@media (max-width: 768px) {
    .aip-field-row {
        grid-template-columns: 1fr;
    }
}

.aip-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.aip-field label {
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.aip-goal-title,
.aip-goal-category,
.aip-goal-deadline,
.aip-time-availability,
.aip-skill-level,
.aip-goal-notes {
    padding: 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.aip-goal-title:focus,
.aip-goal-category:focus,
.aip-goal-deadline:focus,
.aip-time-availability:focus,
.aip-skill-level:focus,
.aip-goal-notes:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.aip-goal-notes {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.aip-char-counter {
    text-align: right;
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

/* Actions */
.aip-goals-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.aip-add-goal-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.aip-add-goal-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.aip-add-goal-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.aip-goals-counter {
    font-size: 1rem;
    color: #666;
    font-weight: 600;
}

#aip-current-goals {
    color: #667eea;
    font-size: 1.2rem;
}

/* Options Section */
.aip-options-section {
    background: white;
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.aip-options-section h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin: 0 0 25px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.aip-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.aip-option {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aip-option label {
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.aip-option select {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

.aip-option select:focus {
    outline: none;
    border-color: #667eea;
}

.aip-checkbox-option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.aip-checkbox-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Actions Section */
.aip-actions-section {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.aip-generate-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 20px 50px;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(39, 174, 96, 0.3);
}

.aip-generate-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 40px rgba(39, 174, 96, 0.4);
}

.aip-generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.aip-action-note {
    margin-top: 20px;
    color: #666;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Loading State */
.aip-loading {
    background: rgba(255, 255, 255, 0.95);
    padding: 60px 40px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.aip-loading-content {
    max-width: 600px;
    margin: 0 auto;
}

.aip-spinner {
    width: 80px;
    height: 80px;
    border: 8px solid #f3f3f3;
    border-top: 8px solid #667eea;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
    margin: 0 auto 30px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.aip-loading h3 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

.aip-loading-message {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.aip-progress-steps {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.aip-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.3;
    transition: all 0.5s ease;
}

.aip-progress-step.active {
    opacity: 1;
    transform: scale(1.1);
}

.aip-step-icon {
    font-size: 2rem;
}

.aip-progress-step span:last-child {
    font-weight: 600;
    color: #2c3e50;
}

/* Error Message */
.aip-error {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.aip-error-content {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.1rem;
}

.aip-error-content .dashicons {
    font-size: 2rem;
}

/* Results Section */
.aip-results {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    display: none;
}

.aip-results-header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 40px;
    text-align: center;
}

.aip-results-header h2 {
    font-size: 2.2rem;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.aip-results-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

.aip-results-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.aip-download-btn,
.aip-save-btn,
.aip-regenerate-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.aip-download-btn {
    background: #27ae60;
    color: white;
}

.aip-save-btn {
    background: #3498db;
    color: white;
}

.aip-regenerate-btn {
    background: #e67e22;
    color: white;
}

.aip-download-btn:hover {
    background: #219653;
    transform: translateY(-2px);
}

.aip-save-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.aip-regenerate-btn:hover {
    background: #d35400;
    transform: translateY(-2px);
}

/* Plan Summary */
.aip-plan-summary {
    padding: 40px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.aip-summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    max-width: 800px;
    margin: 0 auto;
}

.aip-stat {
    background: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.aip-stat:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.aip-stat .dashicons {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 15px;
}

.aip-stat-value {
    display: block;
    font-size: 2.8rem;
    font-weight: 800;
    color: #2c3e50;
    line-height: 1;
    margin: 10px 0;
}

.aip-stat-label {
    font-size: 1rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Plan Details */
.aip-plan-details {
    padding: 40px;
}

.aip-overview-section,
.aip-goals-details-section,
.aip-integration-section,
.aip-accountability-section {
    margin-bottom: 40px;
}

.aip-plan-details h3 {
    font-size: 1.6rem;
    color: #2c3e50;
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 3px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Goal Detail Cards */
.aip-goal-detail-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.aip-goal-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
    flex-wrap: wrap;
    gap: 15px;
}

.aip-goal-detail-title {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.aip-goal-detail-title h4 {
    margin: 0;
    font-size: 1.4rem;
    color: #2c3e50;
}

.aip-goal-category-badge {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.aip-goal-deadline {
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Goal Content Sections */
.aip-goal-detail-content > div {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #f0f0f0;
}

.aip-goal-detail-content > div:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.aip-goal-detail-content h5 {
    font-size: 1.2rem;
    color: #34495e;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.aip-goal-detail-content p {
    color: #555;
    line-height: 1.7;
    margin: 0;
}

.aip-goal-detail-content ul {
    margin: 15px 0 0 20px;
    padding: 0;
}

.aip-goal-detail-content li {
    margin-bottom: 10px;
    color: #555;
    line-height: 1.6;
}

/* Phase Cards */
.aip-phase-card {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.aip-phase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.aip-phase-header h6 {
    margin: 0;
    font-size: 1.1rem;
    color: #2c3e50;
    font-weight: 700;
}

.aip-phase-dates {
    background: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
}

.aip-phase-tasks h7 {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #34495e;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.aip-phase-tasks ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.aip-phase-tasks li {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.aip-task-text {
    flex: 1;
    font-weight: 500;
    color: #2c3e50;
}

.aip-task-due,
.aip-task-time {
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
    color: #666;
}

.aip-phase-milestone {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

/* Integration & Accountability Cards */
.aip-integration-card,
.aip-accountability-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.aip-integration-card > div,
.aip-accountability-card > div {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #f0f0f0;
}

.aip-integration-card > div:last-child,
.aip-accountability-card > div:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Modal */
.aip-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.aip-modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.aip-modal-header {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aip-modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.aip-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aip-modal-body {
    padding: 35px;
    text-align: center;
}

.aip-modal-body p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 30px;
    line-height: 1.6;
}

.aip-modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.aip-modal-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.aip-modal-btn:first-child {
    background: #3498db;
    color: white;
}

.aip-modal-btn.secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #ddd;
}

.aip-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .aip-container {
        padding: 20px;
    }
    
    .aip-header,
    .aip-goals-section,
    .aip-options-section,
    .aip-actions-section {
        padding: 25px;
    }
    
    .aip-header h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .aip-steps {
        gap: 20px;
        flex-wrap: wrap;
    }
    
    .aip-results-header h2 {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .aip-results-actions {
        flex-direction: column;
    }
    
    .aip-goal-detail-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .aip-phase-tasks li {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .aip-task-text,
    .aip-task-due,
    .aip-task-time {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .aip-container {
        background: white !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
    
    .aip-header,
    .aip-goals-section,
    .aip-options-section,
    .aip-actions-section,
    .aip-loading,
    .aip-error,
    .aip-results-header .aip-results-actions,
    .aip-modal {
        display: none !important;
    }
    
    .aip-results {
        box-shadow: none !important;
        display: block !important;
    }
    
    .aip-plan-details {
        padding: 0 !important;
    }
    
    .aip-goal-detail-card,
    .aip-phase-card,
    .aip-integration-card,
    .aip-accountability-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}