:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --light-gray: #f8f9fa;
    --mid-gray: #e9ecef;
    --dark-gray: #495057;
    --border-radius: 10px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f7fb;
    color: #333;
    line-height: 1.6;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 32px;
}

header h1 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--secondary-color);
}

.icon {
    font-size: 1.8rem;
}

.tagline {
    font-size: 1.1rem;
    color: var(--dark-gray);
}

main {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 24px;
    flex: 1;
}

.panel {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 24px;
    height: 600px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel h2 {
    margin-bottom: 20px;
    color: var(--secondary-color);
    font-size: 1.4rem;
    font-weight: 600;
}


/* Document Upload Area */

.upload-area {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.dropzone {
    border: 2px dashed var(--mid-gray);
    border-radius: var(--border-radius);
    padding: 32px;
    text-align: center;
    margin-bottom: 16px;
    transition: var(--transition);
    background: var(--light-gray);
}

.dropzone.highlight {
    border-color: var(--primary-color);
    background: rgba(67, 97, 238, 0.05);
}

.dropzone p {
    margin-bottom: 12px;
    color: var(--dark-gray);
}

.upload-btn {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.upload-btn:hover {
    background: var(--secondary-color);
}

.primary-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 16px;
}

.primary-btn:hover {
    background: var(--secondary-color);
}

.primary-btn:disabled {
    background: #ced4da;
    cursor: not-allowed;
}

.files-container {
    flex: 1;
    overflow-y: auto;
}

.files-container h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--dark-gray);
}

.file-list {
    list-style: none;
}

.file-list li {
    padding: 10px;
    background: var(--light-gray);
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-list li a {
    color: var(--primary-color);
    text-decoration: none;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-list li a:hover {
    text-decoration: underline;
}


/* Chat Area */

.chat-area {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--light-gray);
    border-radius: var(--border-radius);
    margin-bottom: 16px;
}

.message {
    max-width: 80%;
    margin-bottom: 16px;
    position: relative;
}

.message-content {
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
}

.message.human {
    margin-left: auto;
}

.message.ai {
    margin-right: auto;
}

.message.human .message-content {
    background: var(--primary-color);
    color: white;
    border-radius: 16px 16px 4px 16px;
}

.message.ai .message-content {
    background: white;
    color: #333;
    border-radius: 16px 16px 16px 4px;
}

.welcome-message .message-content {
    background: rgba(67, 97, 238, 0.1);
    border: 1px solid rgba(67, 97, 238, 0.2);
}

.input-area {
    display: flex;
    gap: 12px;
}

textarea {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--mid-gray);
    border-radius: 8px;
    resize: none;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

.send-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    background: var(--secondary-color);
}

.send-btn:disabled {
    background: #ced4da;
    cursor: not-allowed;
}

footer {
    text-align: center;
    margin-top: 32px;
    color: var(--dark-gray);
    padding: 12px;
}


/* Responsive Design */

@media (max-width: 900px) {
    main {
        grid-template-columns: 1fr;
    }
    .panel {
        height: auto;
        min-height: 400px;
    }
    .document-panel {
        margin-bottom: 20px;
    }
}


/* LinkedIn Profile Input */

.profile-input {
    background: var(--light-gray);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 16px;
}

.profile-input p {
    margin-bottom: 12px;
    color: var(--dark-gray);
}

.url-input-container {
    display: flex;
    gap: 10px;
}

.url-input-container input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--mid-gray);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.url-input-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}


/* CV Preview */

.cv-preview {
    margin-top: 20px;
    background: white;
    border: 1px solid var(--mid-gray);
    border-radius: var(--border-radius);
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.cv-preview h3 {
    margin-bottom: 12px;
    color: var(--secondary-color);
}

.cv-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cv-payment-notice {
    background-color: rgba(67, 97, 238, 0.1);
    border-left: 4px solid var(--primary-color);
    padding: 12px 16px;
    margin-bottom: 15px;
    border-radius: 6px;
}

.cv-payment-notice p {
    color: var(--secondary-color);
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.5;
}

.secondary-btn {
    background: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.secondary-btn:hover {
    background: rgba(67, 97, 238, 0.05);
}


/* Loader indicator */

.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(67, 97, 238, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* Success/error messages */

.status-message {
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.status-message.success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.status-message.error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.2);
    color: #dc3545;
}


/* Payment Modal Styles */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}


/* Force email collection modal to display by default */

#email-collection-modal {
    display: block;
}

.modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    width: 85%;
    max-width: 500px;
    position: relative;
    animation: slideDown 0.3s;
}

#email-collection-modal .modal-content {
    text-align: center;
    margin: 10% auto;
}

#email-collection-modal h2 {
    color: var(--secondary-color);
    margin-bottom: 15px;
}

#email-collection-modal p {
    margin-bottom: 25px;
    color: var(--dark-gray);
}

#email-collection-form .form-group {
    max-width: 400px;
    margin: 0 auto 20px;
}

#email-collection-form .primary-btn {
    margin-top: 10px;
    min-width: 150px;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: #555;
}

#payment-form {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--mid-gray);
    border-radius: 6px;
    font-size: 14px;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

#card-element {
    padding: 12px;
    border: 1px solid var(--mid-gray);
    border-radius: 6px;
    margin-bottom: 20px;
    background: white;
}

#card-errors {
    color: #dc3545;
    font-size: 0.85rem;
    margin-bottom: 20px;
    min-height: 20px;
}

#submit-payment {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
}

.payment-success {
    text-align: center;
    padding: 20px 0;
}

.payment-success h4 {
    color: #28a745;
    margin-bottom: 10px;
}

.download-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}