/* SD Resume Builder Styles - Mobile First */

.sd-resume-builder {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

.sd-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* Header Styles */
.sd-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
    border-bottom: 2px solid #e1e5e9;
}

.sd-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
}

.sd-subtitle {
    font-size: 16px;
    color: #7f8c8d;
    margin: 0;
    font-weight: 400;
}

/* Form Styles */
.sd-form {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Section Styles */
.sd-section {
    padding: 30px;
    border-bottom: 1px solid #e1e5e9;
    position: relative;
}

.sd-section:last-child {
    border-bottom: none;
}

.sd-section-title {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 25px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
    display: inline-block;
}

/* Grid System */
.sd-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Form Groups */
.sd-form-group {
    position: relative;
}

.sd-form-group label {
    display: block;
    font-weight: 600;
    color: #34495e;
    margin-bottom: 8px;
    font-size: 14px;
    letter-spacing: 0.3px;
}

.sd-form-group label::after {
    content: "*";
    color: #e74c3c;
    margin-left: 3px;
    display: none;
}

.sd-form-group:has(input[required]) label::after,
.sd-form-group:has(textarea[required]) label::after,
.sd-form-group:has(select[required]) label::after {
    display: inline;
}

/* Input Styles */
.sd-input,
.sd-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.5;
    color: #2c3e50;
    background-color: #fff;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.sd-input:focus,
.sd-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    background-color: #fbfcfd;
}

.sd-input::placeholder,
.sd-textarea::placeholder {
    color: #95a5a6;
    font-weight: 400;
}

.sd-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Button Styles */
.sd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 50px;
    box-sizing: border-box;
    font-family: inherit;
    letter-spacing: 0.3px;
}

.sd-btn-primary {
    background-color: #3498db;
    color: #fff;
    border-color: #3498db;
}

.sd-btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.sd-btn-secondary {
    background-color: #95a5a6;
    color: #fff;
    border-color: #95a5a6;
    font-size: 14px;
    padding: 10px 20px;
    min-height: 40px;
}

.sd-btn-secondary:hover {
    background-color: #7f8c8d;
    border-color: #7f8c8d;
}

.sd-btn-danger {
    background-color: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
    font-size: 12px;
    padding: 8px 16px;
    min-height: 36px;
    margin-top: 10px;
}

.sd-btn-danger:hover {
    background-color: #c0392b;
    border-color: #c0392b;
}

/* Submit Container */
.sd-submit-container {
    text-align: center;
    padding: 20px 0;
}

.sd-submit-container .sd-btn {
    min-width: 200px;
    font-size: 16px;
}

/* Dynamic Items */
.education-item,
.experience-item,
.strength-item {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    position: relative;
}

.education-item:first-child,
.experience-item:first-child,
.strength-item:first-child {
    background-color: transparent;
    border: none;
    padding: 0;
}

/* Result Styles */
.sd-result {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    margin-top: 30px;
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.3);
}

.sd-success-message h3 {
    font-size: 24px;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.sd-success-message p {
    font-size: 16px;
    margin: 0 0 25px 0;
    opacity: 0.95;
}

.sd-result .sd-btn {
    background-color: #fff;
    color: #27ae60;
    border-color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sd-result .sd-btn:hover {
    background-color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Loading Animation */
.btn-loading {
    display: inline-flex;
    align-items: center;
}

.btn-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Alert Styles */
.sd-alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    animation: slideInDown 0.3s ease-out;
}

.sd-alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.sd-alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

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

/* Error Field Styles */
.sd-input.error,
.sd-textarea.error {
    border-color: #e74c3c;
    background-color: #fdf2f2;
}

.error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    font-weight: 500;
}

/* Enhanced Button States */
.sd-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.sd-btn:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Responsive Design */
@media (min-width: 480px) {
    .sd-container {
        padding: 30px;
    }

    .sd-title {
        font-size: 32px;
    }

    .sd-grid {
        grid-template-columns: 1fr 1fr;
    }

    .sd-full-width {
        grid-column: 1 / -1;
    }
}

@media (min-width: 768px) {
    .sd-container {
        padding: 40px;
    }

    .sd-section {
        padding: 40px;
    }

    .sd-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .education-item .sd-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .sd-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .education-item .sd-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Mobile Optimizations */
@media (max-width: 480px) {
    .sd-container {
        padding: 15px;
    }

    .sd-section {
        padding: 20px 15px;
    }

    .sd-title {
        font-size: 24px;
    }

    .sd-btn {
        width: 100%;
        margin-bottom: 10px;
    }

    .education-item,
    .experience-item,
    .strength-item {
        padding: 15px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .sd-input,
    .sd-textarea {
        border-width: 3px;
    }

    .sd-btn {
        border-width: 3px;
    }
}

/* Print Styles */
@media print {
    .sd-resume-builder {
        box-shadow: none;
    }

    .sd-btn {
        display: none;
    }
}