/* Application URL field styles */
.application-url-field {
    position: relative;
    margin-bottom: 1rem;
}

.application-url-field .form-control {
    padding-left: 2.5rem;
    font-size: 0.95rem;
}

.application-url-field::before {
    content: '\f0c1';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 1rem;
}

/* URL validation styles - only show when field has a value */
.form-control[type="url"]:valid:not(:placeholder-shown) {
    border-color: #198754;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control[type="url"]:invalid:not(:placeholder-shown) {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Form validation feedback */
.form-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.form-text.text-success {
    color: #198754;
}

.form-text.text-danger {
    color: #dc3545;
}

/* External application badge */
.external-application-badge {
    display: inline-block;
    background-color: #fff3cd;
    color: #856404;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

/* Status indicators */
.status-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-right: 0.75rem;
}

.status-active {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-pending {
    background-color: #fff3e0;
    color: #ef6c00;
}

.status-expired {
    background-color: #ffebee;
    color: #c62828;
}

/* Responsive styles */
@media (max-width: 768px) {
    .application-url-field .form-control {
        padding-left: 2rem;
    }

    .application-url-field::before {
        font-size: 0.9rem;
        left: 0.5rem;
    }

    .external-application-badge {
        display: block;
        margin: 0.5rem 0 0 0;
        text-align: center;
    }

    .status-badge {
        display: block;
        margin: 0.5rem 0;
        text-align: center;
    }
}

/* Bootstrap variable overrides */
:not(.note-editor):not(.note-editor *) {
    --bs-blue: #0d6efd !important;
    --bs-primary: #0d6efd !important;
}

/* Modal header styles */
.modal-header .btn-close {
    padding: 0.5rem 0.5rem !important;
    margin: -0.5rem -0.5rem -0.5rem auto !important;
}

.modal-content {
    border-radius: 0.3rem !important;
}

/* Summernote Custom Styles */
.main-header {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 0.5em;
}

.sub-header {
    font-size: 2em;
    color: #34495e;
    margin-bottom: 0.4em;
}

.section-header {
    font-size: 1.5em;
    color: #2c3e50;
    margin-bottom: 0.3em;
}

.sub-section {
    font-size: 1.25em;
    color: #34495e;
    margin-bottom: 0.3em;
}

.quote-block {
    font-style: italic;
    border-left: 4px solid #3498db;
    padding-left: 1em;
    margin: 1em 0;
    color: #7f8c8d;
}

/* Description guidelines styles */
.description-guidelines {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 1rem;
}

.description-guidelines ol {
    margin-bottom: 0;
    padding-left: 1.2rem;
}

/* Payment section styles */
.payment-section {
    margin-top: 2rem;
}

#card-element {
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    padding: 0.5rem;
}

#card-errors {
    color: #dc3545;
    margin-top: 0.5rem;
}

/* Package card selected state */
.package-card.selected {
    border: 2px solid #0d6efd;
}

/* AI Assistant Container */
.ai-assistant-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

/* AI Assistant Help Text */
.ai-help-text {
    color: #6c757d;
    font-size: 0.95rem;
    margin-bottom: 12px;
    text-align: center;
}

/* AI Assistant Button Group */
.ai-assistant-buttons {
    margin-bottom: 0;
}

/* File Upload Styles */
#jobDescriptionUpload {
    display: none;
}

.ai-assistant-buttons .btn-group {
    width: 100%;
    display: flex;
    gap: 12px;
}

.ai-assistant-buttons .btn {
    flex: 1;
    padding: 10px 20px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    border-width: 2px;
}

.ai-assistant-buttons .btn i {
    font-size: 1.1rem;
}

.ai-assistant-buttons .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ai-assistant-buttons .btn:disabled {
    transform: none;
    box-shadow: none;
    opacity: 0.65;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .ai-assistant-container {
        padding: 12px;
    }
    
    .ai-assistant-buttons .btn-group {
        flex-direction: column;
    }
    
    .ai-assistant-buttons .btn {
        width: 100%;
        margin-bottom: 8px;
    }
}

/* AI Assistant Modal Styles */
/* Preview Generated Description Modal */
.modal-preview-description {
    display: flex;
    flex-direction: column;
    height: 90vh;
    max-height: 800px;
    position: relative;
}

.modal-preview-description .modal-header {
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.modal-preview-description .modal-footer {
    background: #fff;
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 1020;
}

.modal-preview-description .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    position: relative;
}

.preview-generated-description {
    padding: 1.5rem;
    font-size: 0.95rem;
    height: 100%;
}

.preview-generated-description h1,
.preview-generated-description h2,
.preview-generated-description h3,
.preview-generated-description h4,
.preview-generated-description h5 {
    margin-top: 1.2rem;
    margin-bottom: 0.8rem;
    color: #2c3e50;
    font-size: 1.15rem;
    font-weight: 600;
}

.preview-generated-description p,
.preview-generated-description ul,
.preview-generated-description ol {
    margin-bottom: 1rem;
    line-height: 1.5;
    color: #2c3e50;
}

.preview-generated-description ul,
.preview-generated-description ol {
    padding-left: 1.5rem;
}

.preview-generated-description li {
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

/* Diff Preview Styles */
.diff-preview {
    max-height: 500px;
    overflow-y: auto;
    padding: 15px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: #fff;
}

.diff-preview .row {
    margin: 0;
}

.diff-preview .col-md-6 {
    padding: 15px;
}

.diff-preview h6 {
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #dee2e6;
    color: #495057;
    font-weight: 600;
}

.original-content,
.improved-content {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    min-height: 100px;
    font-size: 14px;
    line-height: 1.6;
    color: #212529;
}

.improved-content {
    background-color: #e8f4f8;
    border-left: 3px solid #17a2b8;
}

/* AI Assistant Alert Styles */
.ai-assistant-alert {
    position: relative;
    width: 100%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #dc3545;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.ai-assistant-alert i {
    color: #dc3545;
}

/* Loading State Styles */
.btn-ai-assist .fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* AI Assistant Responsive Adjustments */
@media (max-width: 768px) {
    .diff-preview .col-md-6 {
        padding: 10px;
    }
    
    .diff-preview {
        max-height: 400px;
    }
    
    .ai-assistant-alert {
        max-width: 90%;
        left: 50%;
        transform: translateX(-50%);
        bottom: 10px;
    }
}
