/* Zmienne kolorystyczne - nawiązanie do Policji */
:root {
    --police-blue: #003380;
    --police-blue-light: #0055a4;
    --police-silver: #e9eaec;
    --police-white: #ffffff;
    --police-red: #dc3545;
    --police-green: #28a745;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--police-silver);
    color: #333;
    line-height: 1.6;
}

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

header {
    background: linear-gradient(135deg, var(--police-blue), var(--police-blue-light));
    color: var(--police-white);
    padding: 25px;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

header::before {
    content: "";
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.1) 75%, transparent 75%, transparent);
    background-size: 20px 20px;
    z-index: 0;
    opacity: 0.2;
}

h1 {
    margin: 0;
    font-size: 24px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    position: relative;
    text-shadow: 0 2px 3px rgba(0,0,0,0.2);
    color: white;
}

.card {
    background: var(--police-white);
    border-radius: 0 0 12px 12px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    margin-bottom: 20px;
    position: relative;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

.info-box {
    background-color: rgba(0, 83, 164, 0.05);
    border-left: 4px solid var(--police-blue);
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 5px;
}

.info-box h2 {
    margin-top: 0;
    color: var(--police-blue);
    font-size: 18px;
}

.info-box p, .info-box ul, .info-box li {
    color: #333;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--police-blue);
}

select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--police-silver);
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: var(--police-white);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    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='%23003380' 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 10px center;
    background-size: 20px;
    padding-right: 40px;
    color: #333;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transform: translateY(0);
}

select:hover {
    border-color: var(--police-blue-light);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 51, 128, 0.15);
}

option {
    padding: 10px;
    color: #333;
}

.form-group::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

select:focus {
    border-color: var(--police-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.2);
}

button {
    background: linear-gradient(135deg, var(--police-blue), var(--police-blue-light));
    color: var(--police-white);
    border: none;
    padding: 14px 28px;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 51, 128, 0.3);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

button:hover::before {
    left: 100%;
}

button:hover {
    background: linear-gradient(to right, var(--police-blue-light), var(--police-blue));
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.result {
    margin-top: 25px;
    padding: 18px;
    border-radius: 8px;
    text-align: left;
    font-weight: normal;
    font-size: 16px;
    display: none;
    transition: all 0.4s ease-in-out;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(10px);
    opacity: 0;
    animation-fill-mode: forwards;
}

.result[style*="block"] {
    animation: slideInResult 0.5s ease-out forwards;
}

@keyframes slideInResult {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.result-header {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.result-legal-basis {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    font-style: italic;
}

.result-category {
    background-color: rgba(0, 51, 128, 0.1);
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
    border-left: 3px solid var(--police-blue);
}

.result-details {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #333;
}

.result-practical-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.practical-info {
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid;
}

.practical-info.positive {
    background-color: #f0f9f0;
    border-left-color: var(--police-green);
}

.practical-info.negative {
    background-color: #fef7f7;
    border-left-color: var(--police-red);
}

.practical-info ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.practical-info li {
    margin-bottom: 4px;
    font-size: 14px;
}

.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-left: 4px solid #f39c12;
}

.positive {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-left: 4px solid var(--police-green);
}

.negative {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-left: 4px solid var(--police-red);
}

footer {
    text-align: center;
    margin-top: 20px;
    color: var(--police-blue);
    font-size: 14px;
    transition: opacity 0.3s ease;
}

/* Accessibility */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Focus states */
select:focus,
button:focus {
    outline: 3px solid #ffbf47;
    outline-offset: 2px;
}

button:focus {
    box-shadow: 0 0 0 3px rgba(255, 191, 71, 0.5), 0 4px 12px rgba(0, 51, 128, 0.3);
}

/* Skip links */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--police-blue);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    font-size: 14px;
}

.skip-link:focus {
    top: 6px;
    outline: 2px solid #ffbf47;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --police-blue: #000080;
        --police-blue-light: #0000ff;
        --police-silver: #f0f0f0;
        --police-green: #008000;
        --police-red: #cc0000;
    }
    
    select, button {
        border-width: 2px;
    }
    
    .result {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .result[style*="block"] {
        animation: none;
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    
    button::before {
        transition: none;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
        font-size: 12pt;
    }
    
    .container {
        max-width: none;
        margin: 0;
        padding: 0;
    }
    
    header {
        background: white !important;
        color: black !important;
        border: 2px solid black;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid black;
    }
    
    .welcome-notification {
        display: none;
    }
    
    button {
        display: none;
    }
    
    .result {
        border: 2px solid black;
        background: white !important;
        color: black !important;
    }
}

/* Style dla powiadomienia powitalnego */
.welcome-notification {
    background: linear-gradient(135deg, #e8f5e8, #f0f9f0);
    border: 1px solid #c3e6cb;
    border-left: 4px solid var(--police-green);
    border-radius: 8px;
    margin-bottom: 20px;
    animation: slideInFromTop 0.5s ease-out;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
}

.welcome-content {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #155724;
    font-size: 14px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #155724;
    cursor: pointer;
    padding: 0;
    width: auto;
    height: auto;
    min-width: 24px;
    transition: color 0.2s ease;
    text-transform: none;
    letter-spacing: 0;
    font-weight: bold;
}

.close-btn:hover {
    color: #0a3622;
    transform: none;
    box-shadow: none;
}

@keyframes slideInFromTop {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animacje focus dla form-group */
.form-group {
    position: relative;
    transition: transform 0.2s ease;
}

.form-group:focus-within {
    transform: scale(1.02);
}


/* Responsive Design - Mobile First */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        margin: 0 auto;
    }
    
    header {
        padding: 20px 15px;
        border-radius: 8px 8px 0 0;
    }
    
    h1 {
        font-size: 22px;
        line-height: 1.3;
        letter-spacing: 0.5px;
    }
    
    .card {
        padding: 20px;
        border-radius: 0 0 8px 8px;
    }
    
    .info-box {
        padding: 12px;
        margin-bottom: 20px;
    }
    
    .info-box h2 {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .info-box p, .info-box li {
        font-size: 14px;
        line-height: 1.5;
    }
    
    .form-group {
        margin-bottom: 18px;
    }
    
    label {
        font-size: 15px;
        margin-bottom: 6px;
    }
    
    select {
        padding: 14px 40px 14px 12px;
        font-size: 16px;
        background-size: 18px;
        background-position: right 8px center;
    }
    
    button {
        padding: 16px 24px;
        font-size: 15px;
        letter-spacing: 0.8px;
    }
    
    .result {
        margin-top: 20px;
        padding: 16px;
        font-size: 15px;
    }
    
    .result-header {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .result-legal-basis {
        font-size: 13px;
    }
    
    .result-category {
        padding: 6px 10px;
        font-size: 13px;
        margin-bottom: 12px;
    }
    
    .practical-info {
        padding: 10px;
    }
    
    .practical-info li {
        font-size: 13px;
        margin-bottom: 3px;
    }
    
    .welcome-notification {
        margin-bottom: 15px;
    }
    
    .welcome-content {
        padding: 10px 12px;
        font-size: 13px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .close-btn {
        align-self: flex-end;
        margin-top: -20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    header {
        padding: 15px 10px;
    }
    
    h1 {
        font-size: 18px;
        line-height: 1.2;
    }
    
    .card {
        padding: 15px;
    }
    
    .info-box {
        padding: 10px;
    }
    
    .info-box h2 {
        font-size: 15px;
    }
    
    .info-box p, .info-box li {
        font-size: 13px;
    }
    
    select {
        padding: 12px 35px 12px 10px;
        font-size: 15px;
    }
    
    button {
        padding: 14px 20px;
        font-size: 14px;
    }
    
    .result {
        padding: 12px;
        font-size: 14px;
    }
    
    .result-header {
        font-size: 16px;
    }
    
    .practical-info ul {
        padding-left: 16px;
    }
    
    footer {
        font-size: 12px;
        line-height: 1.4;
    }
}

/* Landscape orientation dla telefonów */
@media (max-width: 768px) and (orientation: landscape) {
    .container {
        padding: 10px 20px;
    }
    
    header {
        padding: 15px;
    }
    
    h1 {
        font-size: 20px;
    }
    
    .card {
        padding: 18px;
    }
}

/* Większe ekrany */
@media (min-width: 1024px) {
    .container {
        max-width: 900px;
        padding: 30px;
    }
    
    header {
        padding: 30px;
    }
    
    h1 {
        font-size: 28px;
    }
    
    .card {
        padding: 30px;
    }
    
    .result {
        font-size: 17px;
    }
    
    .result-header {
        font-size: 22px;
    }
}