/* Learn-In-Depth CV Maker - Main Stylesheet */

:root {
    --primary-color: #6d28d9;
    --primary-dark: #4c1d95;
    --primary-hover: #5b21b6;
    --secondary-color: #f59e0b;
    --secondary-dark: #d97706;
    --success-color: #059669;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --gray-50: #fafaff;
    --gray-100: #f3f0ff;
    --gray-200: #e5e7eb;
    --gray-300: #cbd5e0;
    --gray-700: #4a5568;
    --gray-800: #1f2937;
    --gray-900: #0b1020;
}

/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, .brand-font {
    font-family: 'Cairo', 'Inter', -apple-system, sans-serif;
}

/* Utility Classes */
.gradient-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-accent {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
}

/* Card Components */
.cv-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(11, 16, 32, 0.08);
    transition: all 0.3s ease;
}

.cv-card:hover {
    box-shadow: 0 8px 20px rgba(109, 40, 217, 0.15);
    transform: translateY(-4px);
}

.cv-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.cv-card-body {
    margin-bottom: 16px;
}

.cv-card-footer {
    display: flex;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.4);
}

.btn-accent {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-800);
    padding: 10px 24px;
    border-radius: 8px;
    border: 1px solid var(--gray-300);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--gray-200);
}

/* Form Inputs */
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.1);
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-700);
    font-size: 14px;
}

/* CV Builder Specific */
.builder-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
}

.add-item-btn {
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-item-btn:hover {
    background: var(--primary-dark);
}

/* Timeline for Experience/Education */
.timeline-item {
    position: relative;
    padding-left: 32px;
    padding-bottom: 24px;
    border-left: 2px solid var(--gray-200);
}

.timeline-item:last-child {
    border-left-color: transparent;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--primary-color);
}

/* Skill Tags */
.skill-tag {
    display: inline-block;
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.1), rgba(245, 158, 11, 0.1));
    color: var(--primary-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-right: 8px;
    margin-bottom: 8px;
    border: 1px solid rgba(109, 40, 217, 0.3);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 16, 32, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Template Gallery */
.template-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(11, 16, 32, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

.template-card:hover {
    box-shadow: 0 8px 24px rgba(109, 40, 217, 0.2);
    transform: translateY(-6px);
}

.template-preview {
    width: 100%;
    height: 300px;
    object-fit: cover;
    background: var(--gray-100);
}

.template-preview-frame-wrap {
    width: 100%;
    height: 300px;
    overflow: hidden;
    position: relative;
    background: var(--gray-100);
}

.template-preview-frame-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 357%;
    height: 357%;
    transform: scale(0.28);
    transform-origin: top left;
    border: none;
    pointer-events: none;
}

.template-info {
    padding: 20px;
}

.template-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.template-description {
    font-size: 14px;
    color: var(--gray-700);
    line-height: 1.6;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-primary {
    background: rgba(109, 40, 217, 0.1);
    color: var(--primary-color);
}

.badge-secondary {
    background: rgba(245, 158, 11, 0.12);
    color: var(--secondary-dark);
}

.badge-success {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success-color);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

/* AI Assistant */
.ai-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(109, 40, 217, 0.4);
    z-index: 900;
    transition: all 0.2s ease;
}

.ai-fab:hover {
    transform: scale(1.08);
}

.ai-panel {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    max-height: 70vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(11, 16, 32, 0.25);
    z-index: 901;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.ai-panel.open {
    display: flex;
}

.ai-panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--gray-200);
}

.ai-panel-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.ai-panel-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.ai-panel-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.ai-wand-btn {
    background: rgba(109, 40, 217, 0.08);
    color: var(--primary-color);
    border: 1px solid rgba(109, 40, 217, 0.2);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-wand-btn:hover {
    background: rgba(109, 40, 217, 0.15);
}

.ai-wand-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ats-score-gauge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    font-size: 28px;
    font-weight: 800;
    color: white;
    margin: 0 auto 12px;
    background: conic-gradient(var(--primary-color) calc(var(--score, 0) * 1%), var(--gray-200) 0);
}

.ats-score-gauge span {
    background: white;
    color: var(--gray-900);
    width: 76px;
    height: 76px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
    .cv-card {
        padding: 16px;
    }

    .builder-section {
        padding: 16px;
    }

    .modal-content {
        padding: 24px;
        width: 95%;
    }

    .ai-panel {
        right: 16px;
        bottom: 88px;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white;
    }
}
