/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    -webkit-touch-callout: none !important;
}

body {
    font-family: 'Vazirmatn', 'Tahoma', Arial, sans-serif;
    direction: rtl;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    color: #ffffff;
    overflow-x: hidden;
    position: relative;
}

img {
  -webkit-user-drag: none;
  user-select: none; 
  pointer-events: none;
}

/* ===== Star Field Background ===== */
.star-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.star {
    position: absolute;
    background: #ffffff;
    border-radius: 50%;
    animation: twinkle 3s infinite alternate;
}

.star:nth-child(1) { width: 2px; height: 2px; top: 20%; left: 10%; animation-delay: 0s; }
.star:nth-child(2) { width: 1px; height: 1px; top: 40%; left: 80%; animation-delay: 0.5s; }
.star:nth-child(3) { width: 3px; height: 3px; top: 60%; left: 30%; animation-delay: 1s; }
.star:nth-child(4) { width: 1px; height: 1px; top: 80%; left: 70%; animation-delay: 1.5s; }
.star:nth-child(5) { width: 2px; height: 2px; top: 15%; left: 60%; animation-delay: 2s; }
.star:nth-child(6) { width: 1px; height: 1px; top: 35%; left: 20%; animation-delay: 2.5s; }
.star:nth-child(7) { width: 2px; height: 2px; top: 70%; left: 90%; animation-delay: 3s; }
.star:nth-child(8) { width: 1px; height: 1px; top: 90%; left: 40%; animation-delay: 3.5s; }

@keyframes twinkle {
    0% { opacity: 0.3; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.2); }
}

/* ===== Header ===== */
.header {
    background: rgba(15, 15, 35, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 165, 0, 0.2);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.logo i {
    font-size: 2.5rem;
    color: #ffa500;
    text-shadow: 0 0 20px rgba(255, 165, 0, 0.5);
}

.logo h1 {
    font-size: 2rem;
    font-weight: 600;
    background: linear-gradient(45deg, #ffa500, #ff6b35);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Progress Bar ===== */
.progress-container {
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(20px);
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 165, 0, 0.1);
    position: sticky;
    top: 80px;
    z-index: 999;
}

.progress-bar {
    max-width: 1000px;
    margin: 0 auto 20px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffa500, #ff6b35);
    border-radius: 20px;
    width: 0%;
    transition: width 0.5s ease;
    box-shadow: 0 0 20px rgba(255, 165, 0, 0.5);
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    opacity: 0.4;
    transition: all 0.3s ease;
    cursor: pointer;
}

.step.active {
    opacity: 1;
}

.step.completed {
    opacity: 0.8;
}

.step-number {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid rgba(255, 165, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    background: rgba(15, 15, 35, 0.8);
    transition: all 0.3s ease;
}

.step.active .step-number {
    border-color: #ffa500;
    background: linear-gradient(45deg, #ffa500, #ff6b35);
    color: #000;
    box-shadow: 0 0 20px rgba(255, 165, 0, 0.5);
}

.step.completed .step-number {
    border-color: #00ff88;
    background: #00ff88;
    color: #000;
}

.step-text {
    font-size: 0.8rem;
    text-align: center;
    font-weight: 500;
}

/* ===== Main Container ===== */
.main-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.form-container {
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    border: 1px solid rgba(255, 165, 0, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
}

.form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ffa500, transparent);
}

/* ===== Form Steps ===== */
.form-step {
    display: none;
    padding: 40px;
    min-height: 500px;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

/* ===== Step Content ===== */
.step-content {
    max-width: 100%;
}

.step-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 165, 0, 0.2);
}

.step-header h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: #ffa500;
}

.step-header i {
    font-size: 2.2rem;
    text-shadow: 0 0 20px rgba(255, 165, 0, 0.5);
}

.step-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
}

.step-header p.important {
    color: #ff6b35;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255, 107, 53, 0.3);
}

/* ===== Welcome Card ===== */
.welcome-card {
    background: rgba(15, 15, 35, 0.8);
    border-radius: 20px;
    border: 1px solid rgba(255, 165, 0, 0.3);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, #ffa500, #ff6b35);
    color: #000;
    padding: 25px;
    text-align: center;
}

.card-header i {
    font-size: 3rem;
    margin-bottom: 10px;
    display: block;
}

.card-header h2 {
    font-size: 1.8rem;
    margin: 0;
    font-weight: 600;
}

.card-body {
    padding: 30px;
}

.warning-section h3 {
    color: #ff6b35;
    font-size: 1.4rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.warning-item {
    background: rgba(255, 165, 0, 0.1);
    border: 1px solid rgba(255, 165, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.warning-item h4 {
    color: #ffa500;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.warning-item p,
.warning-item ul {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.7;
}

.warning-item ul {
    padding-right: 20px;
}

.warning-item li {
    margin-bottom: 8px;
}

/* ===== Form Elements ===== */
.step-form {
    width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.form-group label {
    color: #ffa500;
    font-weight: 500;
    font-size: 1rem;
    margin-bottom: 5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: rgba(15, 15, 35, 0.8);
    border: 2px solid rgba(255, 165, 0, 0.3);
    border-radius: 12px;
    padding: 15px;
    font-size: 1rem;
    font-family: inherit;
    color: #ffffff;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ffa500;
    box-shadow: 0 0 20px rgba(255, 165, 0, 0.3);
    background: rgba(15, 15, 35, 0.9);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-help {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin-top: 5px;
}

/* ===== Section Cards ===== */
.section-card {
    background: rgba(15, 15, 35, 0.6);
    border: 1px solid rgba(255, 165, 0, 0.2);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
}

.section-card h3 {
    color: #ffa500;
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 165, 0, 0.3);
}

.time-section {
    background: rgba(255, 165, 0, 0.05);
    border: 1px solid rgba(255, 165, 0, 0.2);
    border-radius: 15px;
    padding: 25px;
    margin-top: 25px;
}

.time-section h3 {
    color: #ffa500;
    font-size: 1.3rem;
    margin-bottom: 20px;
}

/* ===== Confidence Slider ===== */
.confidence-slider {
    margin-top: 20px;
}

.confidence-slider label {
    color: #ffa500;
    font-weight: 500;
    margin-bottom: 15px;
    display: block;
}

.slider-container {
    position: relative;
}

.slider-container input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 10px;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ffa500, #ff6b35);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 165, 0, 0.4);
    border: 2px solid #fff;
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ffa500, #ff6b35);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 4px 15px rgba(255, 165, 0, 0.4);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.slider-value {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(45deg, #ffa500, #ff6b35);
    color: #000;
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===== Personality Grid ===== */
.personality-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.personality-card {
    background: rgba(15, 15, 35, 0.8);
    border: 1px solid rgba(255, 165, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
}

.personality-card label {
    color: #ffa500;
    font-weight: 500;
    margin-bottom: 15px;
    display: block;
}

.rating-slider-container {
    position: relative;
    margin-top: 15px;
}

.personality-slider {
    width: 100%;
    height: 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 15px;
}

.personality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ffa500, #ff6b35);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(255, 165, 0, 0.4);
}

.personality-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ffa500, #ff6b35);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 10px rgba(255, 165, 0, 0.4);
}

.rating-slider-container .slider-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.rating-slider-container .slider-value {
    position: static;
    transform: none;
    background: linear-gradient(45deg, #ffa500, #ff6b35);
    color: #000;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===== Events Section ===== */
.events-container {
    margin-bottom: 30px;
}

.add-event-section {
    text-align: center;
    margin-top: 25px;
}

.add-event-btn {
    background: linear-gradient(45deg, #00ff88, #00cc6a);
    color: #000;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.3);
}

.add-event-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 255, 136, 0.4);
}

/* ===== Navigation Buttons ===== */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 40px;
    background: rgba(15, 15, 35, 0.8);
    border-top: 1px solid rgba(255, 165, 0, 0.2);
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
    min-width: 120px;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(45deg, #ffa500, #ff6b35);
    color: #000;
    box-shadow: 0 4px 20px rgba(255, 165, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 165, 0, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

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

.btn-success {
    background: linear-gradient(45deg, #00ff88, #00cc6a);
    color: #000;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 255, 136, 0.4);
}

/* ===== Messages ===== */
.messages-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10000;
    pointer-events: none;
}

.message {
    background: rgba(15, 15, 35, 0.95);
    border: 1px solid rgba(255, 165, 0, 0.5);
    border-radius: 15px;
    padding: 15px 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    pointer-events: auto;
}

.message.success {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
}

.message.error {
    border-color: #ff4757;
    background: rgba(255, 71, 87, 0.1);
}

.message i {
    font-size: 1.2rem;
}

.message.success i {
    color: #00ff88;
}

.message.error i {
    color: #ff4757;
}

@keyframes slideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .progress-steps {
        padding: 0 10px;
        gap: 5px;
    }
    
    .step-text {
        font-size: 0.7rem;
        max-width: 60px;
    }
    
    .step-number {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    .main-container {
        padding: 20px 10px;
    }
    
    .form-step {
        padding: 20px 15px;
        min-height: 400px;
    }
    
    .step-header h2 {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .personality-grid {
        grid-template-columns: 1fr;
    }
    
    .navigation-buttons {
        padding: 20px 15px;
        flex-direction: column;
        gap: 15px;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
    }
    
    .messages-container {
        left: 10px;
        right: 10px;
    }
}

/* Siblings and Children Specific Styles */
.sibling-detailed-item,
.child-item {
    background: rgba(15, 15, 35, 0.6);
    border: 1px solid rgba(255, 165, 0, 0.2);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
}

.remove-sibling-btn,
.remove-child-btn {
    background: rgba(231, 76, 60, 0.8) !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    font-size: 0.8rem !important;
    transition: all 0.3s ease;
}

.remove-sibling-btn:hover,
.remove-child-btn:hover {
    background: #e74c3c !important;
    transform: scale(1.1);
}

/* Progress steps adjustment for more items */
@media (max-width: 1200px) {
    .progress-steps {
        gap: 8px;
        padding: 0 10px;
    }
    
    .step-text {
        font-size: 0.7rem;
    }
    
    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
}

@media (max-width: 900px) {
    .progress-steps {
        gap: 4px;
        padding: 0 5px;
    }
    
    .step-text {
        font-size: 0.6rem;
        max-width: 50px;
        line-height: 1.2;
    }
    
    .step-number {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
}

@media (max-width: 768px) {
    .progress-steps {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    
    .step {
        min-width: 60px;
    }
    
    .step-text {
        font-size: 0.65rem;
    }
}

/* Enhanced responsive for new sections */
@media (max-width: 480px) {
    .logo {
        flex-direction: column;
        gap: 10px;
    }
    
    .logo i {
        font-size: 2rem;
    }
    
    .logo h1 {
        font-size: 1.3rem;
    }
    
    .form-step {
        padding: 15px 10px;
    }
    
    .section-card {
        padding: 15px;
    }
    
    .card-body {
        padding: 20px 15px;
    }
    
    .warning-item {
        padding: 15px;
    }
    
    .sibling-detailed-item,
    .child-item {
        padding: 15px;
    }
    
    .progress-steps {
        gap: 5px;
    }
    
    .step {
        min-width: 45px;
    }
    
    .step-text {
        font-size: 0.55rem;
        max-width: 40px;
    }
    
    .step-number {
        width: 22px;
        height: 22px;
        font-size: 0.65rem;
    }
}

.footer {
    background: rgba(15, 15, 35, 0.6);
    border-top: 1px solid #3f4a56;
    padding: 2rem 0;
    text-align: center;
    color: #b8c5d1;
    margin-top: auto;
}

.name-footer {
    color: #ffd89b;
    text-decoration: none;
    transition: all 0.2s linear;
}

.name-footer:hover {
    text-decoration: underline;
}

.back-link {
    font-size: 1rem;
    color: #ffd89b;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}