/* AI Applications Reviewer - Frontend Styles */

/* AI Summary Button in Actions List */
.actions li.ai-summary button,
.actions li.ai-generate button,
.buttons .view-ai-summary,
.buttons .generate-ai-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    cursor: pointer !important;
    text-decoration: none !important;
    display: inline-block !important;
    text-align: center !important;
}

.actions li.ai-summary button:hover,
.actions li.ai-generate button:hover,
.buttons .view-ai-summary:hover,
.buttons .generate-ai-summary:hover {
   background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    transform: translateY(-1px);
}

/* .actions li.ai-summary button:before,
.actions li.ai-generate button:before,
.buttons .view-ai-summary:before,
.buttons .generate-ai-summary:before {
    content: "Ã°Å¸Â¤â€“";
    margin-right: 5px;
} */

/* AI Summary Button */
.generate-ai-summary,
.view-ai-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin-left: 8px !important;
    transition: all 0.3s;
}

.generate-ai-summary:hover,
.view-ai-summary:hover {
    transform: translateY(0px) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
    color: white !important;
   background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;

}

.generate-ai-summary i,
.view-ai-summary i {
    font-size: 16px !important;
    top: 0px;
    position: relative;
    padding-right: 0 !important;
}

/* AI Summary Section */
.job-application-ai-summary {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.job-application-ai-summary h3 {
    color: #495057;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.job-application-ai-summary h3:before {
    content: "✨";
    color: #667eea;
    font-size: 20px;
}

/* Modal Styles - Compatible with both PHP and JS modal structures */
#aiar-modal,
.aiar-modal {
    display: none;
    position: fixed;
    z-index: 999999 !important;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
    overflow: auto;
}

.aiar-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background-color: rgba(0, 0, 0, 0.5); */
    overflow: auto;
}



#aiar-modal-content,
.aiar-modal-content,
.aiar-modal-dialog {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 5px;
    /* box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); */
    width: 90%;
    max-width: 800px;
    /* max-height: 80vh; */
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease;
    display: block !important;
    overflow: auto;
    /* border-radius: 10px; */
    overflow: auto;
}

#aiar-modal-body {
    display: block !important;
    min-height: 200px;
}

#aiar-modal-close,
.aiar-modal-close {
    position: absolute;
    right: 40px;
    top: 40px;
    color: #575757;
    font-size: 28px;
    font-weight: 500;
    cursor: pointer;
    z-index: 1;
    transition: color 0.2s ease;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    transition: 0.3s;
    background-color: #eee;
    border-radius: 5px;
}

#aiar-modal-close:hover,
.aiar-modal-close:hover {
    color: #f00;
    background: #ffdddd;
}

/* Summary Content */
.aiar-summary {
    padding: 0;
}

.aiar-summary-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    padding-bottom: 15px;
    /* border-bottom: 2px solid #e9ecef; */
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: baseline;
}

.aiar-summary-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
    display: block;
    align-items: center;
    gap: 10px;
}

.aiar-summary-header h3:before {
  content: "\2728"; /* Unicode for ✨ */
    color: #667eea;
    font-size: 26px;
    margin-right: 3px;
}
.generate-ai-summary .fa-robot:before,
.view-ai-summary .fa-robot:before {
  content: "\2728"; /* Unicode for ✨ */
}

.aiar-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0f0f0;
    color: white;
    padding: 2px 16px;
    border-radius: 20px;
    font-weight: 600;
    margin-left: 0px;
    margin-top: 4px;
}

.aiar-stars {
    font-size: 18px;
    line-height: 1;
}

/* FontAwesome star styling for consistent appearance */
.aiar-stars .fa-star,
.aiar-stars .fa-star-half-o,
.aiar-stars .fa-star-o {
    font-size: 16px;
    margin-right: 2px;
    vertical-align: baseline;
}

.aiar-stars .star-full {
    color: #ffc107;
}

.aiar-stars .star-half {
    color: #ffc107;
}

.aiar-stars .star-empty {
    color: #c6c6c6;
}

.aiar-score {
    font-size: 16px;
    font-weight: 500;
    color: #9b9b9b;
}

/* Summary Sections */
.aiar-section {
    margin-bottom: 25px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 20px;
}

.aiar-section h4 {
    margin: 0 0 5px 0;
    color: #373737;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.aiar-modal-dialog * {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE 10+ */
}

.aiar-modal-dialog *::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}
.aiar-modal-dialog {
    overflow: hidden;
}

.aiar-section p,
.aiar-content {
    margin: 0;
    line-height: 1.6;
    color: #495057;
    font-size: 15px;
}

/* Section-specific styling */
.aiar-pros {
    border-left: 4px solid #28a745;
}

.aiar-pros h4 i {
    color: #28a745;
}

.aiar-cons {
    border-left: 4px solid #dc3545;
}

.aiar-cons h4 i {
    color: #dc3545;
}

.aiar-recommendation {
    background: #fffae6;
    border-color: #fffae6;
    border-left: 4px solid #ffc107;
}

.aiar-recommendation h4 i {
    color: #ffc107;
}

.aiar-sources {
    background: #f8f9fa;
    border-style: dashed;
}

.aiar-sources h4 i {
    color: #6c757d;
}

.aiar-sources p {
    color: #6c757d;
    font-style: italic;
}

/* Actions */
.aiar-actions {
    margin-top: 0;
    padding-top: 0;
    /* border-top: 1px solid #e9ecef; */
    text-align: center;
}

.aiar-actions .button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.aiar-actions .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Loading State */
.aiar-loading {
    text-align: center;
    padding: 50px 30px;
    color: #667eea;
}

/* Minimal loading for cached summaries */
.aiar-loading.aiar-loading-cached {
    padding: 30px;
}

.aiar-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

/* No margin for cached loading spinner */
.aiar-loading-cached .aiar-spinner {
    margin-bottom: 0;
}

.aiar-loading p {
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

/* Error State */
.aiar-error {
    text-align: center;
    padding: 50px 30px;
    color: #dc3545;
}

.aiar-error p {
    font-size: 16px;
    margin: 0;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    #aiar-modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 85vh;
    }
    
    .aiar-summary {
        padding: 20px;
    }
    
    .aiar-summary-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .aiar-summary-header h3 {
        font-size: 20px;
    }
    
    .aiar-section {
        padding: 15px;
    }
    
    .generate-ai-summary,
    .view-ai-summary {
        margin-left: 0 !important;
        margin-top: 8px !important;
        width: 100% !important;
        justify-content: center !important;
    }
}

@media (max-width: 480px) {
    .aiar-summary-header h3 {
        font-size: 18px;
    }
    
    .aiar-rating {
        padding: 6px 12px;
    }
    
    .aiar-stars {
        font-size: 16px;
    }
    
    .aiar-score {
        font-size: 14px;
    }
}



.app-content .buttons { 
    display: flex !important;
    justify-content: flex-start;
    gap: 10px;
}