/**
 * Job Description Generator - Styles
 * HRTest Design System
 */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: transparent;
    min-height: 100vh;
    color: #e5e7eb;
    line-height: 1.6;
}

.container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 8px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px 0;
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section h1 {
    color: white;
    font-size: 28px;
    margin-bottom: 5px;
}

.logo-section p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

/* Layout */
.generator-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    background: rgba(255, 255, 255, 0.06);
    color: #e5e7eb;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #e5e7eb;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.05);
    color: #e5e7eb;
}

.form-control:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.6);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #0077b6 0%, #005f8a 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 119, 182, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-icon {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Checklist Items */
.checklist-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: start;
    gap: 12px;
    transition: all 0.3s;
    color: #e5e7eb;
}

.checklist-item:hover {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(255, 255, 255, 0.07);
}

.checklist-item.disabled {
    opacity: 0.5;
}

.checklist-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-top: 2px;
}

.checklist-item .text {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
}

.checklist-item .delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s;
}

.checklist-item:hover .delete-btn {
    opacity: 1;
}

/* Skill Items */
.skill-item {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.skill-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.skill-item .skill-name {
    flex: 1;
    font-weight: 600;
}

.skill-item .skill-level {
    padding: 4px 12px;
    background: #0077b6;
    color: white;
    border-radius: 12px;
    font-size: 12px;
}

/* Attribute Tags */
.attribute-tag {
    display: inline-block;
    background: #e3f2fd;
    color: #0077b6;
    padding: 8px 16px;
    border-radius: 20px;
    margin: 5px;
    font-size: 14px;
    position: relative;
}

.attribute-tag .remove {
    margin-left: 8px;
    cursor: pointer;
    color: #dc3545;
    font-weight: bold;
}

/* Action Bar */
.action-bar {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: sticky;
    bottom: 20px;
}

/* Preview Panel */
.preview-panel {
    position: relative;
}

.sticky {
    position: sticky;
    top: 20px;
}

.preview-panel .card {
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

.preview-panel .card-body {
    flex: 1;
    overflow-y: auto;
}

#preview {
    background: white;
    padding: 30px;
    border-radius: 8px;
    min-height: 400px;
}

.preview-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.preview-empty span {
    display: block;
    margin-top: 20px;
}

/* Preview Content */
.preview-header {
    border-bottom: 3px solid #0077b6;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.preview-header h1 {
    color: #0077b6;
    font-size: 24px;
    margin-bottom: 10px;
}

.preview-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #666;
}

.preview-section {
    margin-bottom: 25px;
}

.preview-section h3 {
    color: #0077b6;
    font-size: 16px;
    margin-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 8px;
}

.preview-section ul {
    list-style: none;
    padding: 0;
}

.preview-section li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
}

.preview-section li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #0077b6;
    font-weight: bold;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
}

.preview-table td {
    padding: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.preview-table td:first-child {
    font-weight: 600;
    width: 30%;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 40px;
    border-radius: 12px;
    max-width: 500px;
    text-align: center;
    position: relative;
    animation: slideIn 0.3s;
}

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

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
}

.close:hover {
    color: #333;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* Loading State */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0077b6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Responsive */
@media (max-width: 1024px) {
    .generator-layout {
        grid-template-columns: 1fr;
    }

    .preview-panel {
        order: -1;
    }

    .sticky {
        position: relative;
    }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .action-bar {
        flex-direction: column;
    }
}

/* Utility Classes */
.text-muted {
    color: #666;
    font-size: 13px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

.hidden {
    display: none !important;
}
