/* Reset i zmienne */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --background: #f8fafc;
    --card-background: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Cards */
.search-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.search-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.info-banner {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #1e40af;
}

/* Form */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.required {
    color: var(--error-color);
}

input[type="file"],
input[type="number"],
select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
    background: white;
}

input[type="file"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
}

small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}

input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
    cursor: pointer;
}

/* Buttons */
.btn {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.button-group-triple {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .button-group, .button-group-triple {
        grid-template-columns: 1fr;
    }
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-secondary {
    background: #64748b;
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-primary:hover, .btn-secondary:hover, .btn-success:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary:hover {
    background: #475569;
}

.btn-success:hover {
    background: #059669;
}

.btn-primary:active, .btn-secondary:active {
    transform: translateY(0);
}

.btn-primary:disabled, .btn-secondary:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
    transform: none;
}

/* Loader */
.loader {
    text-align: center;
    padding: 3rem;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Results */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.results-header h2 {
    font-size: 1.75rem;
    color: var(--text-primary);
}

.results-info {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Filters */
.filters {
    background: var(--card-background);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: var(--shadow);
}

.filters label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    margin-bottom: 0;
}

.filters select {
    padding: 0.5rem;
    border-radius: 6px;
    width: auto;
}

/* Flights List */
.flights-list {
    display: grid;
    gap: 1rem;
}

.flight-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.2s;
    border: 2px solid transparent;
}

.flight-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.flight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.flight-type {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.flight-type.standard {
    background: #dbeafe;
    color: #1e40af;
}

.flight-type.multi_city {
    background: #fef3c7;
    color: #92400e;
}

.stay-duration {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.125rem;
}

.destination-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    background: #dcfce7;
    color: #166534;
}

.route-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.flight-route {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.flight-point {
    text-align: center;
}

.flight-point.outbound {
    text-align: left;
}

.flight-point.return {
    text-align: right;
}

.airport-code {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.airport-name {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.flight-date {
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-top: 0.25rem;
}

.flight-arrow {
    font-size: 2rem;
    color: var(--secondary-color);
}

.flight-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.window-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.hours-info {
    font-size: 0.75rem;
    color: var(--secondary-color);
    margin-top: 0.25rem;
    font-style: italic;
}

.btn-search-flight {
    background: var(--primary-color);
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-search-flight:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* Error message */
.error-message {
    background: #fee2e2;
    color: var(--error-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--error-color);
    margin-bottom: 1rem;
}

/* Filter warnings/info */
.filter-warning {
    background: #fef3c7;
    color: #92400e;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-left: 4px solid #f59e0b;
    margin: 1rem 0;
    font-size: 0.875rem;
    font-weight: 500;
}

.filter-info {
    background: #dbeafe;
    color: #1e40af;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
    margin: 1rem 0;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 4rem;
    padding: 2rem 0;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .filters {
        flex-direction: column;
    }

    .filters select {
        width: 100%;
    }

    .flight-route {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .flight-arrow {
        transform: rotate(90deg);
        font-size: 1.5rem;
    }

    .flight-point.outbound,
    .flight-point.return {
        text-align: center;
    }

    .flight-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

/* Animacje */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.flight-card {
    animation: fadeIn 0.3s ease-out;
}

.explore-card {
    border: 2px solid var(--success-color);
}

.explore-info {
    background: #f0fdf4;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.explore-info p {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.explore-info ul {
    margin: 0.5rem 0 0 1.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.explore-info li {
    margin: 0.25rem 0;
}

.btn-explore {
    background: var(--success-color) !important;
}

.btn-explore:hover {
    background: #059669 !important;
}

/* Scraped results */
.scraped-card {
    border: 2px solid var(--success-color);
    background: linear-gradient(to bottom, white, #f0fdf4);
}

.scraped-destinations {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.scraped-destinations h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.destinations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.destination-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.dest-name {
    font-weight: 600;
    color: var(--text-primary);
}

.dest-price {
    color: var(--success-color);
    font-weight: 700;
}
