/* Main Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    height: 85vh;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 1.5em;
    color: #000;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal-close:hover {
    background: #e5e5e5;
}

.modal-body {
    padding: 24px;
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

.modal-preview-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.modal-preview {
    width: 100%;
    flex: 1;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    margin-bottom: 20px;
    min-height: 0;
}

.modal-preview.disabled {
    opacity: 0.5;
    filter: grayscale(100%);
}

/* Default CV content styles */
.default-cv-content {
    padding: 40px;
    background: white;
    height: 100%;
    overflow: auto;
    font-family: Georgia, serif;
    color: #999;
}

.default-cv-content h1 {
    font-size: 2em;
    margin-bottom: 10px;
    color: #ccc;
}

.default-cv-content h2 {
    font-size: 1.3em;
    margin: 20px 0 10px 0;
    color: #ccc;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 5px;
}

.default-cv-content p {
    line-height: 1.6;
    margin-bottom: 10px;
    color: #bbb;
}

/* Incomplete overlay */
.incomplete-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
}

.incomplete-message {
    max-width: 400px;
}

.incomplete-message h4 {
    font-size: 1.3em;
    color: #000;
    margin-bottom: 12px;
}

.incomplete-message p {
    color: #666;
    font-size: 1em;
    line-height: 1.5;
}

/* Modal processing state */
.modal-processing-state {
    display: none;
    text-align: center;
    padding: 60px 40px;
}

.modal-processing-state.active {
    display: block;
}

/* Modal actions and buttons */
.modal-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.button {
    padding: 14px 28px;
    background: #000;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
}

.button:hover:not(:disabled) {
    background: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.button:disabled {
    background: white;
    color: #999;
    border: 2px dashed #ddd;
    cursor: not-allowed;
    transform: none;
}

.button.success {
    background: #10b981;
}

.button.success:hover:not(:disabled) {
    background: #059669;
}

.button.success:disabled {
    background: white;
    color: #999;
    border: 2px dashed #ddd;
}

.button.secondary {
    background: white;
    color: #000;
    border: 2px solid #e5e5e5;
}

.button.secondary:hover:not(:disabled) {
    border-color: #000;
    background: #fafafa;
}

.button.secondary:disabled {
    background: white;
    color: #999;
    border: 2px dashed #ddd;
}

/* Download menu */
.download-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #10b981;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    overflow: hidden;
}

.download-menu.active {
    display: block;
}

.download-menu button {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: white;
    text-align: left;
    cursor: pointer;
    font-size: 1em;
    color: #000;
    transition: background 0.2s;
    border-bottom: 1px solid #e5e5e5;
}

.download-menu button:last-child {
    border-bottom: none;
}

.download-menu button:hover {
    background: #f0fdf4;
}