:root {

    --primary-bg: #f4f6f9;

    --card-bg: #ffffff;

    --text-main: #2c3e50;

    --text-muted: #6c757d;

    --warsaw-red: #e74c3c;

    --warsaw-blue: #3498db;

    --accent: #2980b9;

    --success: #27ae60;

    --radius: 12px;

    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);

    --shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.12);

}

.text-center {

    text-align: center;

}

body {

    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    background-color: var(--primary-bg);

    color: var(--text-main);

    line-height: 1.6;

    padding-bottom: 50px;

}



h1, h2, h3 {

    font-weight: 600;


}



.container {

    max-width: 900px;

    margin: 0 auto;

    padding: 20px;

}



/* --- SEKCJA FORMULARZA --- */

.input-section {

    background: var(--card-bg);

    padding: 24px;

    border-radius: var(--radius);

    box-shadow: var(--shadow);

    margin-bottom: 30px;

    border-bottom: 4px solid var(--accent);

}



label {

    font-weight: 600;

    font-size: 0.9rem;

    color: var(--text-muted);

    margin-bottom: 5px;

    display: block;

}



.form-control, .form-select {

    border: 1px solid #dee2e6;

    border-radius: 8px;

    padding: 10px 12px;

    font-size: 1rem;

    transition: border-color 0.2s;

}



.form-control:focus {

    border-color: var(--accent);

    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.15);

    outline: none;

}



/* --- FORM ELEMENTS STYLING (Inputs, Selects, Checkboxes) --- */

input[type="date"],

input[type="time"],

input[type="number"],

input[type="text"],

select {

    width: 100%;

    padding: 12px 14px;

    font-size: 1rem;

    font-family: inherit;

    color: var(--text-main);

    background-color: #fff;

    border: 2px solid #e0e6ed;

    border-radius: 8px;

    transition: all 0.2s ease;

    box-sizing: border-box;

    appearance: none; /* Remove default browser styling */

    -webkit-appearance: none;

    -moz-appearance: none;

    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");

    background-repeat: no-repeat;

    background-position: right 1rem center;

    background-size: 1.2em;

}



/* Remove arrow for non-select inputs */

input[type="date"],

input[type="time"],

input[type="number"],

input[type="text"] {

    background-image: none;

}

/* Re-add calendar/clock icon for date/time if needed or rely on browser default indicators */ 

/* Modern browsers handle date/time inputs well, but appearance: none might hide indicators. 

   Let's keep appearance default for date/time to keep the picker */

input[type="date"],

input[type="time"] {

    appearance: auto; 

    -webkit-appearance: auto;

}





input:focus, select:focus {

    border-color: var(--accent);

    outline: none;

    box-shadow: 0 0 0 4px rgba(41, 128, 185, 0.1);

}



/* Custom Checkbox Styling */

input[type="checkbox"] {

    appearance: none;

    -webkit-appearance: none;

    width: 20px;

    height: 20px;

    border: 2px solid #cbd5e0;

    border-radius: 6px;

    margin-right: 8px;

    position: relative;

    top: 5px; /* Alignment fix */

    cursor: pointer;

    transition: all 0.2s ease;

    background-color: #fff;

}



input[type="checkbox"]:checked {

    background-color: var(--accent);

    border-color: var(--accent);

}



input[type="checkbox"]:checked::after {

    content: '✓';

    position: absolute;

    color: white;

    font-size: 14px;

    font-weight: bold;

    top: 50%;

    left: 50%;

    transform: translate(-50%, -50%);

}



/* Specific Config Grid Layout */

.config-grid {

    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));

    gap: 20px;

    margin-bottom: 30px;

}



.config-grid > div {

    display: flex;

    flex-direction: column;

}



/* --- PRZYCISK GENEROWANIA --- */

#generateBtn {

    background: linear-gradient(135deg, #2980b9, #2c3e50);

    border: none;

    color: white;

    font-weight: 600;

    padding: 12px 30px;

    border-radius: 8px;

    width: 100%;

    text-transform: uppercase;

    letter-spacing: 1px;

    transition: transform 0.2s, box-shadow 0.2s;

}



#generateBtn:hover {

    transform: translateY(-2px);

    box-shadow: 0 6px 15px rgba(44, 62, 80, 0.3);

}



/* --- KARTY ATRAKCJI (GRID) --- */

#attrContainer {

    display: grid;

    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));

    gap: 20px;

    margin-bottom: 40px;

}



.attr-card {

    background: var(--card-bg);

    border: 2px solid transparent;

    border-radius: var(--radius);

    

    cursor: pointer;

    box-shadow: 0 2px 4px rgba(0,0,0,0.05);

    transition: all 0.25s ease;

    position: relative;

    overflow: hidden;

}



.attr-card:hover {

    transform: translateY(-3px);

    box-shadow: var(--shadow-hover);

}



/* Stan zaznaczenia */

.attr-card.selected {

    border-color: var(--accent);

    background-color: #f0f8ff;

}



.attr-card.selected::after {

    content: '✓';

    position: absolute;

    top: 10px;

    right: 10px;

    background: var(--accent);

    color: white;

    width: 24px;

    height: 24px;

    border-radius: 50%;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 14px;

    font-weight: bold;

}



.attr-card h5 {

    font-size: 1.1rem;

    margin-bottom: 8px;

    color: var(--text-main);

}



.attr-card p {

    font-size: 0.9rem;

    color: var(--text-muted);

    margin: 0;

}



/* --- WYNIKI - Timeline --- */

.day-section {

    background: transparent;

    margin-bottom: 40px;

    position: relative;

    padding-bottom: 10px;

}



.day-title {

    font-size: 1.5rem;

    font-weight: 700;

    color: #2c3e50;

    margin-bottom: 30px;

    padding-bottom: 10px;

    border-bottom: 2px solid #e9ecef;

    padding-left: 10px;

}



/* Oś czasu - ciągła linia */

.day-section::before {

    content: '';

    position: absolute;

    top: 60px; /* Zaczyna się pod tytułem */

    bottom: 20px;

    left: 40px; /* Stała pozycja linii */

    width: 4px;

    background: #dde1e5;

    border-radius: 2px;

    z-index: 0;

}



.step {

    background: var(--card-bg);

    border-radius: var(--radius);

    padding: 20px 24px;

    margin-bottom: 25px;

    margin-left: 80px; /* Odsunięcie kart od linii */

    position: relative;

    box-shadow: var(--shadow);

    border-left: none; /* Usuwamy pasek boczny na rzecz kropki */

    transition: transform 0.2s;

}



.step:hover {

    transform: translateX(5px);

}



/* Kropka na osi czasu (Timeline Dot) */

.step::before {

    content: '';

    position: absolute;

    /* Pozycjonowanie relatywne do karty (.step) */

    /* Linia jest na 40px. Środek linii = 42px. 

       Margin-left karty to 80px.

       Kropka ma 20px (12px + 2*4px border). Środek kropki = 10px od jej krawędzi.

       Chcemy środek kropki na 42px.

       Czyli krawędź kropki na 32px od lewej strony containera.

       Obecna pozycja 0 karty to 80px.

       Delta: 32px - 80px = -48px.

    */

    left: -48px; 

    top: 25px; /* Wysokość optyczna (wyrównanie do nagłówka) */

    width: 12px;

    height: 12px;

    border-radius: 50%;

    background: #fff;

    border: 4px solid var(--text-muted);

    z-index: 1;

    box-shadow: 0 0 0 5px var(--primary-bg); /* "Margines" dookoła kropki, żeby nie dotykała linii */

}



/* Stylizacja KROPKI per Linia */

.step.RED::before {

    border-color: var(--warsaw-red);

    background: #fff;

}



.step.BLUE::before {

    border-color: var(--warsaw-blue);

    background: #fff;

}



/* Stylizacja elementów wewnątrz kroku */

.step div:first-child {

    /* Nagłówek przystanku */

    

    justify-content: space-between;

    align-items: center;

    margin-bottom: 10px;

}



.step .line-badge, span[style*="padding:3px"] {

    color: white;

    padding: 4px 8px !important;

    border-radius: 6px;

    font-size: 0.8rem !important;

    font-weight: bold;

    background-color: #95a5a6; /* Fallback */

}

.step.RED .line-badge, .step.RED span[style*="padding:3px"] { background-color: var(--warsaw-red) !important; color: white !important;}

.step.BLUE .line-badge, .step.BLUE span[style*="padding:3px"] { background-color: var(--warsaw-blue) !important; color: white !important; }



.highlight {

    background-color: #e8f5e9;

    color: var(--success);

    padding: 4px 8px;

    border-radius: 4px;

    font-weight: 600;

}



.return-box {

    margin-top: 15px;

    padding: 10px;

    background-color: #f8f9fa;

    border-radius: 6px;

    font-size: 0.9rem;

    border: 1px dashed #ced4da;

    color: #495057;

}



/* Lunch styling */

.step.LUNCH {

    background: #fffdf5;

    border-left: 4px solid #f39c12 !important; /* Force override common step border logic if any */

    padding: 16px 24px;

    display: flex;

    flex-direction: column;

    justify-content: center;

}



.step.LUNCH::before {

    content: '';

    position: absolute;

    left: -44px; /* Default LTR position */

    top: 50%;

    transform: translateY(-50%);

    width: 24px;

    height: 24px;

    background: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f39c12'%3e%3cpath d='M11 9H9V2H7v7H5V2H3v7c0 2.12 1.66 3.84 3.75 3.97V22h2.5v-9.03C11.34 12.84 13 11.12 13 9V2h-2v7zm5-3v8h2.5v8H21V2c-2.76 0-5 2.24-5 4z'/%3e%3c/svg%3e") no-repeat center center;

    background-size: contain;

    border: none;

    border-radius: 0;

    box-shadow: none;

    z-index: 2;

}



/* Transfer styling */

.step.TRANSFER {

    background: #fff;

    border-left: 4px dashed #e67e22 !important;

    opacity: 0.9;

}



.step.TRANSFER::before {

    content: '';

    position: absolute;

    left: -48px;

    top: 50%;

    transform: translateY(-50%);

    width: 12px;

    height: 12px;

    border-radius: 50%;

    background: #fff;

    border: 3px dashed #e67e22;

}



/* RTL overrides for Lunch & Transfer */

[dir="rtl"] .step.LUNCH {

    border-left: none !important;

    border-right: 4px solid #f39c12 !important;

}

[dir="rtl"] .step.LUNCH::before {

    left: auto;

    right: -44px;

}



[dir="rtl"] .step.TRANSFER {

    border-left: none !important;

    border-right: 4px dashed #e67e22 !important;

}

[dir="rtl"] .step.TRANSFER::before {

    left: auto;

    right: -48px;

}



/* Modal Styling */

.modal-content {

    border-radius: var(--radius);

    border: none;

    box-shadow: 0 10px 30px rgba(0,0,0,0.2);

}

.modal-header {

    background-color: var(--primary-bg);

    border-bottom: 1px solid #e9ecef;

}



/* Modal Overlay & Container */

.modal {

    display: none; /* Hidden by default */

    position: fixed;

    top: 0;

    left: 0;

    width: 100%;

    height: 100%;

    background: rgba(44, 62, 80, 0.6); /* Semi-transparent backdrop */

    z-index: 10000;

    justify-content: center;

    align-items: center;

    backdrop-filter: blur(4px); /* Modern blur effect */

}



/* Show state */

.modal.show {

    display: flex !important;

}



/* Modal Content Box */

.modal-content {

    background: #fff;

    padding: 30px;

    border-radius: 16px;

    width: 90%;

    max-width: 500px;

    position: relative;

    box-shadow: 0 15px 40px rgba(0,0,0,0.25);

    animation: slideUp 0.3s ease-out;

}



@keyframes slideUp {

    from { transform: translateY(20px); opacity: 0; }

    to { transform: translateY(0); opacity: 1; }

}



/* Close Button */

.close-modal {

    position: absolute;

    top: 15px;

    right: 20px;

    background: none;

    border: none;

    font-size: 1.8rem;

    color: #999;

    cursor: pointer;

    line-height: 1;

    transition: color 0.2s;

}



.close-modal:hover {

    color: var(--warsaw-red);

}



.modal-desc {

    color: var(--text-muted);

    font-size: 1rem;

    margin-bottom: 20px;

    line-height: 1.5;

}



.btn-main {

    background: linear-gradient(135deg, #2980b9, #2573a7);

    color: white;

    border: none;

    border-radius: 8px;

    cursor: pointer;

    transition: all 0.3s ease;

    padding: 12px 24px;

    font-weight: 600;

    font-size: 1rem;

    box-shadow: 0 4px 6px rgba(41, 128, 185, 0.2);

    text-transform: uppercase;

    letter-spacing: 0.5px;

    display: inline-block;

    width: auto;

}



.btn-main:hover {

    background: linear-gradient(135deg, #3498db, #2980b9);

    transform: translateY(-2px);

    box-shadow: 0 6px 12px rgba(41, 128, 185, 0.3);

}



.btn-main:active {

    transform: translateY(0);

    box-shadow: 0 2px 4px rgba(41, 128, 185, 0.2);

}



/* Secondary Button (Close etc.) */

button[style*="background:#eee"], button[onclick="closeModal()"]:not(.close-modal) {

    background: #f1f3f5 !important;

    color: var(--text-main) !important;

    border: 1px solid #dee2e6 !important;

    font-weight: 600;

    transition: all 0.2s;

}



button[style*="background:#eee"]:hover, button[onclick="closeModal()"]:not(.close-modal):hover {

    background: #e9ecef !important;

    border-color: #ced4da !important;

}



.modal-footer {

    border-top: none;

}

.custom-modal {

    display: none; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.5); position:fixed; z-index:9999; justify-content:center; align-items:center;

}

.show { display: flex !important; }

.modal-box {

    background:white; padding:20px; border-radius:8px; max-width:500px; width:90%; position:relative;

}

.close-btn { position:absolute; top:10px; right:15px; cursor:pointer; font-size:1.5em; }



/* --- RTL SUPPORT (Arabic) --- */

[dir="rtl"] {

    text-align: right;

}



[dir="rtl"] input, 

[dir="rtl"] select, 

[dir="rtl"] textarea {

    text-align: right;

    background-position: left 1rem center;

}



[dir="rtl"] input[type="checkbox"] {

    margin-right: 0;

    margin-left: 8px;

}



[dir="rtl"] .day-section::before {

    left: auto;

    right: 40px;

}



[dir="rtl"] .step {

    margin-left: 0;

    margin-right: 80px;

}



[dir="rtl"] .step:hover {

    transform: translateX(-5px);

}



[dir="rtl"] .step::before {

    left: auto;

    right: -48px;

}



/* Fix for lunch icon in RTL */

[dir="rtl"] .step[style*="lunch"]::before {

    left: auto;

    right: -44px;

}



/* Fix for modal close button */

[dir="rtl"] .close-modal, 

[dir="rtl"] .close-btn {

    right: auto;

    left: 20px;

}

[dir="rtl"] .attr-card.selected::after {

    right: auto;

    left: 10px;

}



/* Fix for day title padding */

[dir="rtl"] .day-title {

    padding-left: 0;

    padding-right: 10px;

}





/* --- TICKET STYLING --- */

.ticket-wrapper {

    margin-top: 30px;

    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));

}



.ticket {

    display: flex;

    background: white;

    border-radius: 12px;

    overflow: hidden;

    position: relative;

    max-width: 600px;

    margin: 0 auto;

}



.ticket-stub {

    background: var(--accent);

    color: white;

    padding: 20px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    min-width: 100px;

}



.ticket-icon {

    font-size: 2rem;

    margin-bottom: 8px;

}



.ticket-label {

    font-size: 0.8rem;

    text-transform: uppercase;

    letter-spacing: 1px;

    font-weight: 600;

    text-align: center;

    opacity: 0.9;

}



/* Simulated perforation (rip line) */

.ticket-rip {

    width: 20px;

    background-image: radial-gradient(circle at 0 50%, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 0px), 

                      radial-gradient(circle at 100% 50%, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 0px);

    background-position: 0 10px;

    background-size: 20px 20px;

    background-repeat: repeat-y;

    position: relative;

    background-color: white; /* Fallback */

    /* Advanced CSS holes */

    background: 

        radial-gradient(circle at top left, transparent 8px, white 9px) top left,

        radial-gradient(circle at bottom left, transparent 8px, white 9px) bottom left,

        radial-gradient(circle at top right, transparent 8px, white 9px) top right,

        radial-gradient(circle at bottom right, transparent 8px, white 9px) bottom right;

    background-size: 50% 50%;

    background-repeat: no-repeat;

    display: none; /* Simplified below */

}



/* Easier perforation using border */

.ticket-rip {

    width: 0;

    border-left: 2px dashed #cbd5e0;

    margin: 10px 0;

}



.ticket-main {

    flex: 1;

    padding: 24px;

    display: flex;

    flex-direction: column;

    justify-content: center;

    position: relative;

}



/* Notch effect for perforation aesthetics */

.ticket::before, .ticket::after {

    content: '';

    position: absolute;

    left: 140px; /* Adjust based on ticket-stub width */

    width: 20px;

    height: 20px;

    background-color: var(--primary-bg);

    border-radius: 50%;

    z-index: 10;

}



.ticket::before { top: -10px; }

.ticket::after { bottom: -10px; }



.ticket-name {

    font-size: 1.25rem;

    font-weight: 700;

    color: var(--text-main);

    margin-bottom: 8px;

    line-height: 1.3;

}



.ticket-note {

    font-size: 0.95rem;

    color: var(--text-muted);

    font-style: italic;

    background: #f8f9fa;

    padding: 8px 12px;

    border-radius: 6px;

    display: inline-block;

    align-self: flex-start;

}



/* RTL Support for Ticket */

[dir='rtl'] .ticket-main {

    text-align: right;

}

[dir='rtl'] .ticket::before, 

[dir='rtl'] .ticket::after {

    left: auto;

    right: 140px;

}

[dir='rtl'] .ticket-note {

    align-self: flex-start; /* Aligns to start (Right in RTL) */

}



/* Adjust ticket-rip for flex order or remove it if using pseudo elements */



