/* Custom CSS for RightWayResume */

/* Help Section Styles */
.help-section {
    border-radius: 10px;
    transition: transform 0.2s;
}

.help-section:hover {
    transform: translateY(-2px);
}

.screenshot-container {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.step-number {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

/* Chatbot Styles */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    z-index: 1000;
    display: none;
    flex-direction: column;
}

.chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(45deg, #007bff, #0056b3);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
    z-index: 1001;
    transition: all 0.3s ease;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,123,255,0.4);
    color: white;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: var(--bs-body-bg);
}

.message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
}

.message.user {
    justify-content: flex-end;
}

.message-content {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 14px;
    color: var(--bs-body-color);
}

.message.bot .message-content {
    background: var(--bs-secondary-bg);
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
}

.message.user .message-content {
    background: var(--bs-primary);
    color: white;
}

.chat-input-container {
    padding: 15px;
    border-top: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
}

.chat-input-container .form-control {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    color: var(--bs-body-color);
}

.chat-input-container .form-control:focus {
    background: var(--bs-body-bg);
    border-color: var(--bs-primary);
    color: var(--bs-body-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.chat-input-container .btn {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
}

.typing-indicator {
    display: none;
    padding: 10px 15px;
    font-style: italic;
    color: var(--bs-secondary);
}

.suggestion-btn {
    margin: 2px;
    font-size: 12px;
    padding: 5px 10px;
    background: var(--bs-secondary-bg) !important;
    border: 1px solid var(--bs-border-color) !important;
    color: var(--bs-body-color) !important;
    border-radius: 4px !important;
}

.suggestion-btn:hover {
    background: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    color: white !important;
}

/* Dark mode specific overrides for chatbot */
[data-bs-theme="dark"] .chatbot-container {
    background: var(--bs-dark);
    border-color: var(--bs-border-color-translucent);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

[data-bs-theme="dark"] .chat-messages {
    background: var(--bs-dark);
}

[data-bs-theme="dark"] .message.bot .message-content {
    background: var(--bs-gray-800);
    border-color: var(--bs-border-color-translucent);
    color: var(--bs-gray-100);
}

[data-bs-theme="dark"] .chat-input-container {
    background: var(--bs-dark);
    border-color: var(--bs-border-color-translucent);
}

[data-bs-theme="dark"] .chat-input-container .form-control {
    background: var(--bs-gray-800);
    border-color: var(--bs-border-color-translucent);
    color: var(--bs-gray-100);
}

[data-bs-theme="dark"] .chat-input-container .form-control:focus {
    background: var(--bs-gray-800);
    border-color: var(--bs-primary);
    color: var(--bs-gray-100);
}

[data-bs-theme="dark"] .suggestion-btn {
    background: var(--bs-gray-800) !important;
    border: 1px solid var(--bs-gray-600) !important;
    color: var(--bs-gray-100) !important;
    border-radius: 4px !important;
}

[data-bs-theme="dark"] .suggestion-btn:hover {
    background: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    color: white !important;
}

[data-bs-theme="dark"] .typing-indicator {
    color: var(--bs-gray-400);
}

/* Page-specific help button */
.page-help-btn {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: rgba(0, 123, 255, 0.1);
    border: 1px solid var(--bs-primary);
    border-radius: 30px;
    padding: 10px 15px;
    font-size: 14px;
    z-index: 999;
    transition: all 0.3s ease;
}

.page-help-btn:hover {
    background: var(--bs-primary);
    color: white;
}

/* Help tooltip */
.help-tooltip {
    position: absolute;
    background: var(--bs-dark);
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    padding: 15px;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1002;
    display: none;
}

/* Search results styling */
#searchResults {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
}

#searchResults .border-bottom {
    border-color: var(--bs-border-color) !important;
}

#searchResults a {
    color: var(--bs-body-color);
}

#searchResults a:hover {
    color: var(--bs-primary);
    background-color: var(--bs-secondary-bg);
}

/* Color picker controls */
.form-control-color {
    width: 100%;
    height: 40px;
    padding: 2px;
    border: 2px solid var(--bs-border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.form-control-color:hover {
    border-color: var(--bs-primary);
}

.form-control-color::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 4px;
}

.form-control-color::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

.form-control-color::-moz-color-swatch {
    border: none;
    border-radius: 3px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .chatbot-container {
        width: calc(100vw - 40px);
        height: 400px;
        bottom: 10px;
        right: 10px;
        left: 10px;
    }

    .chatbot-toggle {
        bottom: 10px;
        right: 10px;
    }

    .page-help-btn {
        display: none;
    }

    .modal-header .d-flex {
        flex-wrap: wrap;
        gap: 4px;
    }

    .form-control-color {
        width: 35px;
        height: 25px;
    }

    .modal-header .form-label {
        font-size: 0.75rem;
    }
}

/* Dark theme adjustments */
[data-bs-theme="dark"] .help-section {
    background: var(--bs-dark);
    border: 1px solid var(--bs-border-color);
}

[data-bs-theme="dark"] .card-header {
    border-bottom: 1px solid var(--bs-border-color);
}

/* Animation for help sections */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.help-section {
    animation: fadeInUp 0.6s ease-out;
}

/* Suggestion buttons in chat */
.suggestion-btn {
    margin: 2px;
    font-size: 12px;
    padding: 5px 10px;
}

/* Help icon pulsing animation */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

.chatbot-toggle.pulse {
    animation: pulse 2s infinite;
}

/* Status indicators */
.online-indicator {
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    display: inline-block;
    margin-left: 5px;
}

/* FAQ accordion styling */
.accordion-button {
    font-weight: 500;
}

.accordion-button:not(.collapsed) {
    background-color: var(--bs-primary);
    color: white;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Loading spinner for chat */
.chat-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--bs-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Help badge */
.help-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: var(--bs-danger);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

/* Dashboard and Resume Management Styles */
.dashboard-card {
    transition: transform 0.2s ease-in-out;
}

.dashboard-card:hover {
    transform: translateY(-2px);
}

/* Resume Table Enhancements */
.table th {
    font-weight: 600;
    font-size: 0.875rem;
    border-bottom: 2px solid #dee2e6;
    background-color: #f8f9fa;
    color: #495057;
}

.resume-row {
    transition: all 0.2s ease;
}

.resume-row:hover {
    background-color: rgba(0, 123, 255, 0.05);
    transform: translateX(2px);
}

.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

/* Search and Filter Styling */
.input-group-text {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.form-select, .form-control {
    border-color: #dee2e6;
}

.form-select:focus, .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Badge Styling */
.badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
}

/* Progress Bar in Table */
.progress {
    border-radius: 10px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 10px;
}

/* Button Group Enhancements */
.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Pagination Styling */
.pagination-sm .page-link {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.pagination .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* Empty State Styling */
.text-center .bg-light {
    border: 2px dashed #dee2e6;
    transition: all 0.3s ease;
}

.text-center:hover .bg-light {
    border-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.05) !important;
}

/* Colored Header Backgrounds */
.text-white-50 {
    color: rgba(255, 255, 255, 0.75) !important;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }

    .btn-group-sm .btn {
        padding: 0.125rem 0.25rem;
        font-size: 0.75rem;
    }

    .resume-row h6 {
        font-size: 0.875rem;
    }

    .pagination-sm {
        justify-content: center;
    }
}

.recommendation-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.1);
}

.recommendation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Learning Timeline Styles */
.learning-timeline {
    position: relative;
    padding-left: 30px;
}

.learning-timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #007bff, #ffc107, #28a745);
}

.timeline-item {
    position: relative;
    margin-bottom: 25px;
}

.timeline-marker {
    position: absolute;
    left: -19px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.timeline-content {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #007bff;
}

/* Enhanced Card Styles */
.dashboard-section-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

/* Extension features fade animation */
.fade-feature {
    transition: opacity 0.3s ease-in-out;
    opacity: 1;
}

.fade-feature span {
    display: inline-block;
    font-style: italic;
}

.dashboard-section-header h5 {
    margin: 0;
    font-weight: 600;
}

.dashboard-section-header small {
    opacity: 0.9;
}

/* Certification Cards */
.certification-card {
    border-left: 4px solid #28a745;
    transition: all 0.3s ease;
}

.certification-card:hover {
    border-left-width: 6px;
    transform: translateX(5px);
}

/* Market Demand Badges */
.badge.bg-success {
    background-color: #198754 !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
}

/* Industry Insights */
.industry-insights .list-group-item {
    border: none;
    padding: 0.5rem 0;
}

.industry-insights .badge {
    font-size: 0.8em;
}

/* Enhanced Dashboard Card Styling */
.dashboard-card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
}

.dashboard-card .card-header {
    border: none;
    position: relative;
    overflow: hidden;
}

.dashboard-card .card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.dashboard-card:hover .card-header::before {
    left: 100%;
}

/* Quick Stats Cards Enhancement */
.card.text-center {
    transition: all 0.3s ease;
    border-radius: 12px;
    border: none;
}

.card.text-center:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.card.text-center .card-body {
    padding: 2rem 1.5rem;
}

.card.text-center i {
    transition: transform 0.3s ease;
}

.card.text-center:hover i {
    transform: scale(1.1);
}

/* Resume Table Enhancements */
.table-responsive {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.table th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem 0.75rem;
    color: #495057 !important;
}

.resume-row {
    border: none;
    transition: all 0.2s ease;
}

.resume-row:hover {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.03) 0%, rgba(13, 110, 253, 0.08) 100%);
    transform: translateX(3px);
}

.resume-row td {
    border: none;
    padding: 1rem 0.75rem;
    vertical-align: middle;
    color: var(--bs-body-color);
}

.resume-row td .text-muted {
    color: var(--bs-gray-600) !important;
    font-weight: 500;
}

/* Company name badge styling for better contrast */
.resume-row td .badge.bg-info {
    background-color: #0f5132 !important;
    color: white !important;
    font-weight: 600;
}

.resume-row td .badge.bg-info.bg-opacity-20 {
    background-color: #0f5132 !important;
    color: white !important;
    opacity: 1 !important;
}

/* Search and Filter Styling */
.input-group .form-control,
.form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.input-group .form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
    transform: translateY(-1px);
}

.input-group-text {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #e9ecef;
    border-right: none;
    color: #6c757d;
}

/* Badge Enhancements */
.badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.875rem;
    border-radius: 20px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Pagination styling to match job search page */
.pagination-sm .page-link {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.pagination-sm .page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.custom-pagination .page-link {
    border-radius: 0.375rem;
    margin: 0 0.125rem;
    border: 1px solid #dee2e6;
    color: #6c757d;
    transition: all 0.2s ease;
}

.custom-pagination .page-link:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
}

.custom-pagination .page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
}

.custom-pagination .page-item.disabled .page-link {
    color: #adb5bd;
    background-color: #fff;
    border-color: #dee2e6;
}

/* Button Group Styling */
.btn-group-sm .btn {
    border-radius: 6px;
    margin: 0 2px;
    transition: all 0.2s ease;
}

.btn-group-sm .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Pagination Enhancement */
.pagination-sm .page-link {
    border-radius: 6px;
    margin: 0 2px;
    border: none;
    background: #f8f9fa;
    color: #6c757d;
    transition: all 0.2s ease;
}

.pagination-sm .page-link:hover {
    background: #0d6efd;
    color: white;
    transform: translateY(-1px);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #0d6efd 0%, #0056b3 100%);
    border: none;
}

/* Enhanced Empty State */
.text-center .bg-light {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    transition: all 0.3s ease;
    padding: 3rem 2rem;
}

.text-center:hover .bg-light {
    border-color: #0d6efd;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.03) 0%, rgba(13, 110, 253, 0.08) 100%) !important;
    transform: translateY(-2px);
}

/* Career Insights Card */
.career-insights-item {
    padding: 1rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.8);
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.career-insights-item:hover {
    background: rgba(255,255,255,0.95);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .learning-timeline {
        padding-left: 20px;
    }

    .timeline-marker {
        left: -14px;
        width: 8px;
        height: 8px;
    }

    .learning-timeline::before {
        left: 6px;
    }

    .dashboard-card .card-body {
        padding: 1.5rem 1rem;
    }

    .table-responsive {
        font-size: 0.875rem;
        margin: 0 -0.5rem;
    }

    .btn-group-sm .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
        margin: 0 1px;
    }
}

/* Custom styles for the resume builder application */

.resume-builder-container {
    max-width: 900px;
    margin: 0 auto;
}

.step-indicator {
    position: relative;
    padding: 20px 0;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #e9ecef;
    z-index: 1;
}

.step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 8px;
}

.step.active .step-number {
    background: #0d6efd;
    color: white;
}

.step.completed .step-number {
    background: #198754;
    color: white;
}

.step-title {
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    margin: 0;
}

/* Form styling */
.form-floating > label {
    padding: 1rem 0.75rem;
}

.btn-outline-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.2);
}

.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Resume card specific styles */
.resume-card-item {
    transition: all 0.3s ease;
    position: relative;
}

/* Resume card styling with overflow protection */
.resume-card-item .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    border: 1px solid #e9ecef;
    overflow:hidden; /* Prevent any content overflow */
}

/* Card body with proper positioning */
.resume-card-item .card-body {
    position: relative;
    overflow: hidden;
    word-wrap: break-word;
}

/* Resume card title styling with proper truncation */
.resume-card-item .card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    margin-top: 0;
    padding-right: 50px; /* Space for delete button */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: calc(100% - 50px); /* Explicit width constraint */
    max-width: calc(100% - 50px);
    display: block;
}

/* Question text display - ensure full visibility */
.card-title {
    overflow: visible !important;
    text-overflow: unset !important;
    white-space: normal !important;
    max-width: none !important;
    word-wrap: break-word;
    line-height: 1.4;
}

/* Specific overrides for question cards */
.personalized-questions .card-title,
.profile-questions .card-title {
    overflow: visible !important;
    text-overflow: unset !important;
    white-space: normal !important;
    max-width: none !important;
    padding-right: 0 !important;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Question labels should show full text */
.form-label {
    overflow: visible !important;
    text-overflow: unset !important;
    white-space: normal !important;
    word-wrap: break-word;
    line-height: 1.4;
    display: block;
    width: 100%;
}

/* Question purpose text */
.text-muted.small {
    overflow: visible !important;
    text-overflow: unset !important;
    white-space: normal !important;
    word-wrap: break-word;
    line-height: 1.3;
}

.resume-card-item .btn-group {
    gap: 0;
    margin-top: auto;
}

.resume-card-item .btn-group .btn {
    flex: 1;
    font-size: 0.875rem;
}

/* Delete button positioning */
.resume-card-item .btn-outline-danger {
    position: absolute !important;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 10;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1;
    border-radius: 0.25rem;
    width: auto;
    height: auto;
}

/* Mobile specific adjustments with better truncation */
@media (max-width: 768px) {
    .resume-card-item .card-title {
        font-size: 0.9rem;
        padding-right: 45px;
        width: calc(100% - 45px);
        max-width: calc(100% - 45px);
    }

    .resume-card-item .btn-outline-danger {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }

    .resume-card-item .flex-grow-1.min-width-0 {
        max-width: calc(100% - 50px);
    }
}

@media (max-width: 576px) {
    .resume-card-item .col-6 {
        margin-bottom: 0.5rem;
    }

    .resume-card-item .d-grid {
        gap: 0.5rem !important;
    }

    .resume-card-item .btn-group {
        display: flex;
        width: 100%;
    }

    /* Stack buttons vertically on very small screens */
    .resume-card-item .btn-group .btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.375rem;
    }
}

/* Fix for positioned elements within cards */
.card .position-absolute {
    position: absolute !important;
    z-index: 10;
}

.card .card-body {
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Ensure delete buttons stay within card bounds */
.card .btn-outline-danger {
    top: 0.5rem;
    right: 0.5rem;
    z-index: 10;
}

/* Prevent text overflow in card titles */
.card-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100% - 50px); /* Account for delete button space */
}

/* Custom Pagination Styling */
.custom-pagination {
    --bs-pagination-bg: var(--bs-body-bg);
    --bs-pagination-border-color: var(--bs-border-color);
    --bs-pagination-hover-bg: var(--bs-secondary-bg);
    --bs-pagination-hover-border-color: var(--bs-primary);
    --bs-pagination-active-bg: #667eea;
    --bs-pagination-active-border-color: #667eea;
    --bs-pagination-active-color: #fff;
    --bs-pagination-disabled-bg: var(--bs-body-bg);
    --bs-pagination-disabled-color: var(--bs-secondary-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.custom-pagination .page-item {
    margin: 0 2px;
}

.custom-pagination .page-link {
    background-color: var(--bs-pagination-bg);
    border: 1px solid var(--bs-pagination-border-color);
    border-radius: 6px;
    padding: 0.375rem 0.75rem;
    font-weight: 500;
    color: var(--bs-body-color);
    transition: all 0.2s ease;
}

.custom-pagination .page-item:not(.disabled) .page-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.custom-pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.custom-pagination .page-item.disabled .page-link {
    background-color: var(--bs-pagination-disabled-bg);
    color: var(--bs-pagination-disabled-color);
    border-color: var(--bs-border-color);
    opacity: 0.6;
}

/* Dark theme specific pagination styling */
[data-bs-theme="dark"] .custom-pagination {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .custom-pagination .page-link {
    background-color: var(--bs-dark);
    border-color: var(--bs-border-color-translucent);
    color: var(--bs-gray-100);
}

[data-bs-theme="dark"] .custom-pagination .page-item:not(.disabled) .page-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

/* Navigation disabled state styling */
.navbar-nav .nav-link.disabled {
    pointer-events: none;
    cursor: default;
    opacity: 0.6;
}

.navbar-nav .nav-link.active.disabled {
    background-color: var(--bs-primary);
    color: var(--bs-white) !important;
    border-radius: 0.375rem;
    opacity: 0.8;
}

.navbar-nav .nav-link.active.disabled:hover {
    background-color: var(--bs-primary);
    color: var(--bs-white) !important;
}

/* Dark theme specific navigation disabled styling */
[data-bs-theme="dark"] .navbar-nav .nav-link.active.disabled {
    background-color: var(--bs-primary);
    color: var(--bs-white) !important;
}

[data-bs-theme="dark"] .custom-pagination .page-item.disabled .page-link {
    background-color: var(--bs-gray-800);
    color: var(--bs-gray-400);
    border-color: var(--bs-gray-600);
}

@media (max-width: 576px) {
    .custom-pagination .page-link {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }

    .custom-pagination .page-item {
        margin: 0 1px;
    }

    /* Ensure question text is fully visible on mobile */
    .personalized-questions .card-title,
    .profile-questions .card-title,
    .form-label {
        font-size: 0.95rem !important;
        line-height: 1.4 !important;
        overflow: visible !important;
        text-overflow: unset !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        max-width: none !important;
    }

    .badge {
        font-size: 0.7rem !important;
        margin-bottom: 0.25rem !important;
        display: inline-block !important;
    }
}

/* User Navigation Styling */
.user-nav-link {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.user-nav-link:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-color: var(--bs-primary);
    transform: translateY(-1px);
}

.user-dropdown {
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    margin-top: 0.5rem;
}

.user-dropdown-item {
    padding: 0.75rem 1.5rem;
    transition: all 0.2s ease;
    border-radius: 0.5rem;
    margin: 0 0.5rem;
}

.user-dropdown-item:not(.text-danger):hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: var(--bs-primary);
}

.user-dropdown-item.text-danger:hover {
    background: rgba(220, 53, 69, 0.1);
    color: var(--bs-danger);
}

/* Dark theme adjustments for user nav */
[data-bs-theme="dark"] .user-nav-link {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-color: rgba(102, 126, 234, 0.3);
}

[data-bs-theme="dark"] .user-nav-link:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%);
}

[data-bs-theme="dark"] .user-dropdown {
    background: var(--bs-dark);
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .user-dropdown-item:not(.text-danger):hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    color: #667eea;
}

[data-bs-theme="dark"] .user-dropdown-item.text-danger:hover {
    background: rgba(220, 53, 69, 0.15);
}

/* Profile image placeholder hover effect */
.profile-placeholder-hover:hover {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.profile-placeholder-hover:hover .fas {
    color: white !important;
    transform: scale(1.1);
}

/* Dark theme adjustments for profile placeholder hover */
[data-bs-theme="dark"] .profile-placeholder-hover:hover {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.4);
}

/* Auto-resize textareas */
    textarea {
        resize: vertical;
    }

    /* Enhanced Page break dividers for resume previews */
    .page-break {
        position: relative;
        margin-bottom: 30px;
        padding-bottom: 20px;
    }

    .page-break:not(:last-child)::after {
        content: '';
        position: absolute;
        bottom: -15px;
        left: 50%;
        transform: translateX(-50%);
        width: 85%;
        height: 2px;
        background: linear-gradient(90deg, 
            transparent 0%, 
            rgba(0,0,0,0.05) 10%, 
            rgba(0,0,0,0.15) 50%, 
            rgba(0,0,0,0.05) 90%, 
            transparent 100%);
        z-index: 1;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

    .page-break:not(:last-child)::before {
        content: '';
        position: absolute;
        bottom: -12px;
        left: 50%;
        transform: translateX(-50%);
        width: 70%;
        height: 1px;
        background: linear-gradient(90deg, 
            transparent 0%, 
            rgba(0,0,0,0.02) 20%, 
            rgba(0,0,0,0.08) 50%, 
            rgba(0,0,0,0.02) 80%, 
            transparent 100%);
        z-index: 2;
    }

    /* Enhanced shadow for page separation */
    .resume-page {
        box-shadow: 
            0 8px 25px rgba(0,0,0,0.15),
            0 4px 15px rgba(0,0,0,0.1),
            0 2px 8px rgba(0,0,0,0.08),
            0 1px 4px rgba(0,0,0,0.06);
        margin-bottom: 25px;
        margin-top: 0;
        border-radius: 4px;
        position: relative;
        border: 1px solid rgba(0,0,0,0.12);
    }

    .resume-page:not(:last-child) {
        border-bottom: 3px solid rgba(0,0,0,0.15);
        margin-bottom: 30px;
    }

    .resume-page:first-child {
        margin-top: 0 !important;
    }

    .resume-page:not(:last-child)::after {
        content: '';
        position: absolute;
        bottom: -15px;
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        height: 3px;
        background: linear-gradient(90deg, 
            transparent 0%, 
            rgba(0,0,0,0.03) 15%, 
            rgba(0,0,0,0.12) 50%, 
            rgba(0,0,0,0.03) 85%, 
            transparent 100%);
        border-radius: 1px;
        z-index: 1;
    }

    /* Target the actual cover letter structure - cover-letter-page class - ONLY IN PREVIEW MODAL */
    .modal #resumePreviewFrame .cover-letter-page,
    .modal #resumePreviewFrame div.cover-letter-page,
    .modal #resumePreviewFrame iframe .cover-letter-page,
    .modal #resumePreviewFrame iframe div.cover-letter-page,
    .modal #resumePreviewFrame iframe body .cover-letter-page,
    #resumePreviewModal .cover-letter-page,
    #resumePreviewModal div.cover-letter-page,
    #resumePreviewModal iframe .cover-letter-page,
    #resumePreviewModal iframe div.cover-letter-page,
    #resumePreviewModal iframe body .cover-letter-page,
    .cover-letter-page {
        border-bottom: 3px solid rgba(0,0,0,0.15) !important;
        margin-bottom: 30px !important;
        margin-top: 0 !important;
        padding: 30px 20px !important;
        padding-bottom: 30px !important;
        box-shadow: 
            0 8px 25px rgba(0,0,0,0.15),
            0 4px 15px rgba(0,0,0,0.1),
            0 2px 8px rgba(0,0,0,0.08),
            0 1px 4px rgba(0,0,0,0.06) !important;
        border-radius: 4px !important;
        position: relative !important;
        border: 1px solid rgba(0,0,0,0.12) !important;
        background: white !important;
        width: 8.5in !important;
        min-height: 11in !important;
        max-width: 8.5in !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Add divider after cover letter sections - ONLY IN PREVIEW MODAL */
    .modal #resumePreviewFrame .cover-letter-page:not(:last-child)::after,
    .modal #resumePreviewFrame iframe .cover-letter-page:not(:last-child)::after,
    .modal #resumePreviewFrame div.cover-letter-page:not(:last-child)::after,
    #resumePreviewModal .cover-letter-page:not(:last-child)::after,
    #resumePreviewModal iframe .cover-letter-page:not(:last-child)::after,
    #resumePreviewModal div.cover-letter-page:not(:last-child)::after {
        content: '';
        display: block;
        position: absolute;
        bottom: -18px;
        left: 50%;
        transform: translateX(-50%);
        width: 85%;
        height: 3px;
        background: linear-gradient(90deg, 
            transparent 0%, 
            rgba(0,0,0,0.06) 15%, 
            rgba(0,0,0,0.18) 50%, 
            rgba(0,0,0,0.06) 85%, 
            transparent 100%);
        border-radius: 2px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.12);
        z-index: 1;
    }

    .modal #resumePreviewFrame .cover-letter-page:not(:last-child)::before,
    .modal #resumePreviewFrame iframe .cover-letter-page:not(:last-child)::before,
    .modal #resumePreviewFrame div.cover-letter-page:not(:last-child)::before,
    #resumePreviewModal .cover-letter-page:not(:last-child)::before,
    #resumePreviewModal iframe .cover-letter-page:not(:last-child)::before,
    #resumePreviewModal div.cover-letter-page:not(:last-child)::before {
        content: '';
        display: block;
        position: absolute;
        bottom: -14px;
        left: 50%;
        transform: translateX(-50%);
        width: 70%;
        height: 1px;
        background: linear-gradient(90deg, 
            transparent 0%, 
            rgba(0,0,0,0.04) 25%, 
            rgba(0,0,0,0.10) 50%, 
            rgba(0,0,0,0.04) 75%, 
            transparent 100%);
        z-index: 2;
    }

    /* Ensure cover letter content has proper styling matching resume pages */
    .cover-letter-content {
        position: relative;
        padding: 20px;
        background: white;
        border-radius: 2px;
        box-shadow: 
            0 2px 8px rgba(0,0,0,0.08),
            0 4px 16px rgba(0,0,0,0.04),
            0 1px 0px rgba(0,0,0,0.02);
        margin-bottom: 25px;
    }

    /* Direct targeting of iframe structure - Universal approach */
    #resumePreviewFrame {
        border: none;
        width: 100%;
        height: 100%;
    }

/* Template Selection Scrollable Container */
.template-selection-container {
    height: 100%; /* Fill the flex container */
    min-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 0.5rem;
    background: var(--bs-body-bg);
    flex: 1 1 auto;
}

.template-selection-container::-webkit-scrollbar {
    width: 6px;
}

.template-selection-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.template-selection-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.template-selection-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Template Grid Layout */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}



/* Step 4 Template Selection Styles (matching dashboard) */
#step4TemplateSelection .template-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#step4TemplateSelection .template-card {
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

#step4TemplateSelection .template-card:hover {
    border-color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

#step4TemplateSelection .template-card.template-selected {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#step4TemplateSelection .template-card.template-locked {
    opacity: 0.6;
    cursor: not-allowed;
}

#step4TemplateSelection .template-card.template-locked:hover {
    transform: none;
    border-color: #e5e7eb;
}

#step4TemplateSelection .template-preview {
    position: relative;
    width: 100%;
    height: 60px;
    border-radius: 0.25rem;
    overflow: hidden;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

#step4TemplateSelection .template-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#step4TemplateSelection .template-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: white;
}

#step4TemplateSelection .template-card:hover .template-overlay {
    opacity: 1;
}

#step4TemplateSelection .template-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#step4TemplateSelection .template-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
}

#step4TemplateSelection .template-badges {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

#step4TemplateSelection .template-badges .badge {
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
}

    /* Apply styling to ALL divs in preview iframe that contain cover letters */
    body iframe,
    iframe body,
    iframe html {
        background: transparent !important;
    }

    /* Universal iframe content styling - target any content that might be a cover letter */
    iframe body > div,
    iframe html > body > div,
    iframe body div[style*="min-height"],
    iframe body .header + div,
    iframe body > div:first-child,
    iframe html body > div:first-child,
    iframe body div[style*="page-break-after"],
    iframe body div[style*="position: relative"] {
        border: 1px solid rgba(0,0,0,0.12) !important;
        border-radius: 4px !important;
        margin-bottom: 30px !important;
        margin-top: 0 !important;
        padding: 30px 20px !important;
        padding-bottom: 30px !important;
        border-bottom: 3px solid rgba(0,0,0,0.15) !important;
        box-shadow: 
            0 8px 25px rgba(0,0,0,0.15),
            0 4px 15px rgba(0,0,0,0.1),
            0 2px 8px rgba(0,0,0,0.08),
            0 1px 4px rgba(0,0,0,0.06) !important;
        position: relative !important;
        background: white !important;
        min-height: 11in !important;
    }

    /* Ensure iframe content has proper document styling with no top gap */
    iframe body {
        padding: 0 20px 20px 20px !important;
        margin: 0 !important;
        background: #f8f9fa !important;
    }

    /* Remove ALL top spacing from iframe content */
    iframe body > *:first-child,
    iframe body > div:first-child,
    iframe body > .cover-letter-page:first-child,
    iframe body > .resume-page:first-child,
    iframe html > body > *:first-child {
        margin-top: 0 !important;
        padding-top: 30px !important;
    }

    /* Target cover letter divs more aggressively with stronger shadows - ONLY IN PREVIEW MODAL */
    .modal #resumePreviewFrame iframe body div[style*="page-break-after: always"],
    .modal #resumePreviewFrame iframe body > div[style*="margin: 0"],
    .modal #resumePreviewFrame iframe body > div[style*="padding: 0"],
    .modal #resumePreviewFrame iframe body > div[style*="position: relative"],
    .modal #resumePreviewFrame iframe body > div[style*="width: 100%"],
    #resumePreviewModal iframe body div[style*="page-break-after: always"],
    #resumePreviewModal iframe body > div[style*="margin: 0"],
    #resumePreviewModal iframe body > div[style*="padding: 0"],
    #resumePreviewModal iframe body > div[style*="position: relative"],
    #resumePreviewModal iframe body > div[style*="width: 100%"] {
        border: 2px solid rgba(0,0,0,0.15) !important;
        border-radius: 6px !important;
        margin-bottom: 30px !important;
        margin-top: 0 !important;
        padding: 30px 20px !important;
        border-bottom: 4px solid rgba(0,0,0,0.2) !important;
        box-shadow: 
            0 12px 35px rgba(0,0,0,0.2),
            0 8px 20px rgba(0,0,0,0.15),
            0 4px 12px rgba(0,0,0,0.1),
            0 2px 6px rgba(0,0,0,0.08) !important;
        position: relative !important;
        background: white !important;
        min-height: 10in !important;
    }

    /* Page separator for iframe content */
    iframe .page-break,
    iframe .resume-page,
    iframe .cover-letter-page {
        margin-bottom: 20px !important;
        page-break-after: always;
    }

    /* Dark theme adjustments for page dividers */
    [data-bs-theme="dark"] .page-break:not(:last-child)::after {
        background: linear-gradient(90deg, 
            transparent 0%, 
            rgba(255,255,255,0.05) 10%, 
            rgba(255,255,255,0.15) 50%, 
            rgba(255,255,255,0.05) 90%, 
            transparent 100%);
        box-shadow: 0 1px 3px rgba(255,255,255,0.05);
    }

    [data-bs-theme="dark"] .modal #resumePreviewFrame .cover-letter-page,
    [data-bs-theme="dark"] .modal #resumePreviewFrame div.cover-letter-page,
    [data-bs-theme="dark"] .modal #resumePreviewFrame iframe .cover-letter-page,
    [data-bs-theme="dark"] .modal #resumePreviewFrame iframe div.cover-letter-page,
    [data-bs-theme="dark"] .modal #resumePreviewFrame iframe body .cover-letter-page,
    [data-bs-theme="dark"] .modal #resumePreviewFrame iframe body > div,
    [data-bs-theme="dark"] .modal #resumePreviewFrame iframe html > body > div,
    [data-bs-theme="dark"] .modal #resumePreviewFrame iframe body div[style*="page-break-after: always"],
    [data-bs-theme="dark"] .modal #resumePreviewFrame iframe body > div[style*="position: relative"],
    [data-bs-theme="dark"] #resumePreviewModal .cover-letter-page,
    [data-bs-theme="dark"] #resumePreviewModal div.cover-letter-page,
    [data-bs-theme="dark"] #resumePreviewModal iframe .cover-letter-page,
    [data-bs-theme="dark"] #resumePreviewModal iframe div.cover-letter-page,
    [data-bs-theme="dark"] #resumePreviewModal iframe body .cover-letter-page,
    [data-bs-theme="dark"] #resumePreviewModal iframe body > div,
    [data-bs-theme="dark"] #resumePreviewModal iframe html > body > div,
    [data-bs-theme="dark"] #resumePreviewModal iframe body div[style*="page-break-after: always"],
    [data-bs-theme="dark"] #resumePreviewModal iframe body > div[style*="position: relative"] {
        box-shadow: 
            0 12px 40px rgba(0,0,0,0.8),
            0 8px 25px rgba(0,0,0,0.6),
            0 4px 15px rgba(0,0,0,0.4),
            0 2px 8px rgba(255,255,255,0.05) !important;
        border-bottom: 4px solid rgba(255,255,255,0.2) !important;
        border: 2px solid rgba(255,255,255,0.15) !important;
        background: var(--bs-dark) !important;
        margin-top: 0 !important;
    }

    [data-bs-theme="dark"] iframe body {
        background: var(--bs-gray-900) !important;
        padding: 0 20px 20px 20px !important;
        margin: 0 !important;
    }

    [data-bs-theme="dark"] .resume-page {
        box-shadow: 
            0 8px 30px rgba(0,0,0,0.6),
            0 4px 20px rgba(0,0,0,0.4),
            0 2px 10px rgba(0,0,0,0.3),
            0 1px 4px rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.12);
        border-bottom: 3px solid rgba(255,255,255,0.15);
    }

    [data-bs-theme="dark"] .modal #resumePreviewFrame .cover-letter-page:not(:last-child)::after,
    [data-bs-theme="dark"] .modal #resumePreviewFrame iframe .cover-letter-page:not(:last-child)::after,
    [data-bs-theme="dark"] .modal #resumePreviewFrame div.cover-letter-page:not(:last-child)::after,
    [data-bs-theme="dark"] #resumePreviewModal .cover-letter-page:not(:last-child)::after,
    [data-bs-theme="dark"] #resumePreviewModal iframe .cover-letter-page:not(:last-child)::after,
    [data-bs-theme="dark"] #resumePreviewModal div.cover-letter-page:not(:last-child)::after {
        background: linear-gradient(90deg, 
            transparent 0%, 
            rgba(255,255,255,0.06) 15%, 
            rgba(255,255,255,0.18) 50%, 
            rgba(255,255,255,0.06) 85%, 
            transparent 100%);
        box-shadow: 0 2px 4px rgba(255,255,255,0.08);
    }

    [data-bs-theme="dark"] .modal #resumePreviewFrame .cover-letter-page:not(:last-child)::before,
    [data-bs-theme="dark"] .modal #resumePreviewFrame iframe .cover-letter-page:not(:last-child)::before,
    [data-bs-theme="dark"] .modal #resumePreviewFrame div.cover-letter-page:not(:last-child)::before,
    [data-bs-theme="dark"] #resumePreviewModal .cover-letter-page:not(:last-child)::before,
    [data-bs-theme="dark"] #resumePreviewModal iframe .cover-letter-page:not(:last-child)::before,
    [data-bs-theme="dark"] #resumePreviewModal div.cover-letter-page:not(:last-child)::before {
        background: linear-gradient(90deg, 
            transparent 0%, 
            rgba(255,255,255,0.04) 25%, 
            rgba(255,255,255,0.10) 50%, 
            rgba(255,255,255,0.04) 75%, 
            transparent 100%);
    }

    [data-bs-theme="dark"] .cover-letter-content {
        background: var(--bs-dark);
        box-shadow: 
            0 2px 8px rgba(0,0,0,0.3),
            0 4px 16px rgba(0,0,0,0.2),
            0 1px 0px rgba(255,255,255,0.05);
    }

    [data-bs-theme="dark"] .resume-page {
        box-shadow: 
            0 2px 8px rgba(0,0,0,0.3),
            0 4px 16px rgba(0,0,0,0.2),
            0 1px 0px rgba(255,255,255,0.05);
        border-bottom: 2px solid rgba(255,255,255,0.08);
    }

    /* Edit container styles for modals */
    .edit-container {
        background: white;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .edit-container .form-control, 
    .edit-container .form-select {
        margin-bottom: 15px;
    }

    .edit-container textarea {
        font-family: 'Times New Roman', serif;
        font-size: 14px;
        line-height: 1.6;
    }

    .edit-container .btn-group {
        margin-top: 20px;
    }

    .edit-container .meta-info {
        background: #e9ecef;
        padding: 15px;
        border-radius: 4px;
        margin-bottom: 20px;
        font-size: 14px;
        color: #666;
    }

/* Toast Notifications */
.toast-container {
    z-index: 9999 !important;
}

.toast {
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    min-width: 350px;
    animation: slideInRight 0.3s ease-out;
}

.toast .toast-body {
    padding: 1rem 1.25rem;
    font-weight: 500;
}

.toast .btn-close {
    margin: 0.5rem 0.75rem 0.5rem 0;
}

.toast.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
}

.toast.bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%) !important;
}

.toast.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #f39c12 100%) !important;
    color: #000 !important;
}

.toast.bg-warning .btn-close {
    filter: invert(1);
}

.toast.bg-info {
    background: linear-gradient(135deg, #17a2b8 0%, #3498db 100%) !important;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.hide {
    animation: slideOutRight 0.3s ease-in;
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Dark theme adjustments for toasts */
[data-bs-theme="dark"] .toast.bg-warning {
    color: #000 !important;
}

[data-bs-theme="dark"] .toast {
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Dark theme template selection overrides */
[data-bs-theme="dark"] .template-selection-container {
    background: var(--bs-dark);
    border-color: var(--bs-border-color-translucent);
}

/* Improved modal layout for better height consistency */
.modal-xl .modal-dialog {
    max-width: 90vw;
}

.modal-xl .modal-content {
    min-height: 80vh;
    max-height: 90vh;
}

/* Ensure template selection fills available space */
.template-selection-container.flex-fill {
    height: auto !important;
    min-height: 400px;
    flex: 1 1 auto;
}

[data-bs-theme="dark"] .template-card {
    background: var(--bs-gray-800);
    border-color: var(--bs-border-color-translucent);
}

[data-bs-theme="dark"] .template-card:hover {
    border-color: var(--bs-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .template-card.template-selected {
    background: rgba(13, 110, 253, 0.15);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
}

[data-bs-theme="dark"] .template-card.template-locked {
    background: var(--bs-gray-900);
}

/* Template Card Layout and Styling */
.template-card {
    border: 2px solid var(--bs-border-color);
    border-radius: 0.75rem;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    min-height: 140px;
    margin-bottom: 0.75rem;
    margin-right: 0.5rem;
    overflow: hidden;
}

.template-card:hover {
    border-color: var(--bs-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.template-card.template-selected {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.template-card.template-locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.template-card.template-locked:hover {
    transform: none;
    border-color: var(--bs-border-color);
    box-shadow: none;
}

/* Template Card Header - Full Width Colored Title Area */
.template-header {
    padding: 0.75rem 1rem;
    margin: 0;
    flex-shrink: 0;
}

/* Template Name Styling - Full Width with Colored Background */
.template-name {
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.3;
    margin: 0;
    color: white !important;
    word-wrap: break-word;
    text-align: center;
    width: 100%;
}

/* Template Content Area - Description */
.template-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem;
    position: relative;
}

/* Template Description Styling - Full Width */
.template-description {
    font-size: 0.9rem;
    color: #6b7280 !important;
    line-height: 1.4;
    flex-grow: 1;
    word-wrap: break-word;
    margin-bottom: 0.75rem;
    width: 100%;
}

/* Template Badges Area - Bottom Right */
.template-badges {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
    justify-content: flex-end;
}


/* Template Badge Styling */
.template-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.template-badge.free {
    color: #16a34a;
}

.template-badge.pro {
    color: #3b82f6;
}

.template-badge.premium {
    color: #ffc800;
}

/* Lock Icon Styling */
.template-lock-icon {
    color: #6b7280;
    font-size: 1.2rem;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

/* Dark Theme Template Card Styling */
[data-bs-theme="dark"] .template-card {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--bs-border-color-translucent);
}

[data-bs-theme="dark"] .template-card:hover {
    border-color: var(--bs-primary);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .template-card.template-selected {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

[data-bs-theme="dark"] .template-card.template-locked {
    background: var(--bs-gray-900);
}

/* Template Header Background Colors for Light Theme */
.template-header.free {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.template-header.pro {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.template-header.premium {
    background: linear-gradient(135deg, #f5cb32 0%, #ffc800 100%);
}

/* Dark Theme Template Header Background Colors */
[data-bs-theme="dark"] .template-header.free {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

[data-bs-theme="dark"] .template-header.pro {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

[data-bs-theme="dark"] .template-header.premium {
    background: linear-gradient(135deg, #f5cb32 0%, #ffc800 100%);
}

/* Dark Theme Text Colors */
[data-bs-theme="dark"] .template-name {
    color: white !important;
}

[data-bs-theme="dark"] .template-description {
    color: var(--bs-gray-300) !important;
}

/* Dark Theme Badge Colors */
[data-bs-theme="dark"] .template-badge {
    background: rgb(77, 77, 77, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-bs-theme="dark"] .template-badge.free {
    color: #4ade80;
}

[data-bs-theme="dark"] .template-badge.pro {
    color: #2563eb;
}

[data-bs-theme="dark"] .template-badge.premium {
    color: #ffc800;
}

[data-bs-theme="dark"] .template-lock-icon {
    color: var(--bs-gray-400);
}

/* Responsive Template Cards */
@media (max-width: 768px) {
    .template-card {
        min-height: 120px;
    }

    .template-header {
        padding: 0.5rem 0.75rem;
    }

    .template-name {
        font-size: 1rem;
    }

    .template-content {
        padding: 0.5rem 0.75rem;
    }

    .template-description {
        font-size: 0.85rem;
        margin-bottom: 2rem; /* More space for badges */
    }

    .template-badges {
        bottom: 0.5rem;
        right: 0.5rem;
        gap: 0.25rem;
    }

    .template-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
}

/* AI Career Coach Chatbot Styles */
.chatbot-status {
    padding: 8px 15px;
    border-bottom: 1px solid #e9ecef;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatbot-status.online {
    background-color: #d4edda;
    color: #155724;
}

.chatbot-status.offline {
    background-color: #f8d7da;
    color: #721c24;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    font-size: 8px !important;
}

.status-dot.online {
    color: #28a745;
}

.status-dot.offline {
    color: #dc3545;
}

.chatbot-help-links {
    margin: 10px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #007bff;
}

.help-links-title {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.help-link {
    display: inline-block;
    padding: 4px 8px;
    margin: 2px 4px 2px 0;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 11px;
    transition: background-color 0.2s;
}

.help-link:hover {
    background-color: #0056b3;
    color: white;
    text-decoration: none;
}

.chatbot-suggestions {
    padding: 0 15px;
    max-height: 100px;
    overflow-y: auto;
}

.upload-area {
                transition: all 0.3s ease;
                cursor: pointer;
                background-color: var(--bs-body-bg);
                color: var(--bs-body-color);
            }

            .upload-area.drag-over {
                background-color: rgba(13, 110, 253, 0.1);
                border-color: #2196f3 !important;
                transform: scale(1.02);
            }

            .upload-area:hover {
                background-color: var(--bs-secondary-bg);
                border-color: #007bff !important;
            }

            /* Dark theme specific upload area */
            [data-bs-theme="dark"] .upload-area {
                background-color: var(--bs-dark);
                color: var(--bs-gray-100);
                border-color: var(--bs-border-color);
            }

            [data-bs-theme="dark"] .upload-area:hover {
                background-color: var(--bs-gray-800);
                border-color: var(--bs-primary) !important;
            }

            [data-bs-theme="dark"] .upload-area.drag-over {
                background-color: rgba(13, 110, 253, 0.2);
                border-color: var(--bs-primary) !important;
            }

.upload-area {
                transition: all 0.3s ease;
                cursor: pointer;
                background-color: var(--bs-body-bg);
                color: var(--bs-body-color);
            }

            .upload-area.drag-over {
                background-color: rgba(13, 110, 253, 0.1);
                border-color: #2196f3 !important;
                transform: scale(1.02);
            }

            .upload-area:hover {
                background-color: var(--bs-secondary-bg);
                border-color: #007bff !important;
            }

            /* Dark theme specific upload area */
            [data-bs-theme="dark"] .upload-area {
                background-color: var(--bs-dark);
                color: var(--bs-gray-100);
                border-color: var(--bs-border-color);
            }

            [data-bs-theme="dark"] .upload-area:hover {
                background-color: var(--bs-gray-800);
                border-color: var(--bs-primary) !important;
            }

            [data-bs-theme="dark"] .upload-area.drag-over {
                background-color: rgba(13, 110, 253, 0.2);
                border-color: var(--bs-primary) !important;
            }

.upload-area {
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    background-color: #f8f9fa;
}

.upload-area.drag-over {
    background-color: #e3f2fd;
    border-color: #2196f3 !important;
}

.border-dashed {
    border-style: dashed !important;
}

.quick-start-step .modal-content {
    min-height: 400px;
}

.quick-start-step {
    animation: fadeIn 0.3s ease-in;
}

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

/* Quick start modal dark theme fixes */
[data-bs-theme="dark"] .quick-start-step .modal-content {
    background-color: var(--bs-dark);
    color: var(--bs-gray-100);
}

[data-bs-theme="dark"] .quick-start-step .card {
    background-color: var(--bs-gray-800);
    border-color: var(--bs-border-color);
    color: var(--bs-gray-100);
}

[data-bs-theme="dark"] .quick-start-step .card-body {
    background-color: var(--bs-gray-800);
    color: var(--bs-gray-100);
}

[data-bs-theme="dark"] .quick-start-step .alert-info {
    background-color: rgba(13, 110, 253, 0.1);
    border-color: rgba(13, 110, 253, 0.3);
    color: var(--bs-gray-100);
}

[data-bs-theme="dark"] .quick-start-step .alert-success {
    background-color: rgba(25, 135, 84, 0.1);
    border-color: rgba(25, 135, 84, 0.3);
    color: var(--bs-gray-100);
}

[data-bs-theme="dark"] .quick-start-step .alert-primary {
    background-color: rgba(13, 110, 253, 0.1);
    border-color: rgba(13, 110, 253, 0.3);
    color: var(--bs-gray-100);
}

[data-bs-theme="dark"] .quick-start-step .alert-light {
    background-color: var(--bs-gray-800);
    border-color: var(--bs-border-color);
    color: var(--bs-gray-300);
}