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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #344973 0%, #2a3a5c 25%, #1e2942 100%);
    min-height: 100vh;
    padding: 10px;
    position: relative;
    /* PWA optimizations */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection for inputs and content */
input, textarea, .contact-phone, .contact-email, .contact-name {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* PWA specific styles */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .container {
        margin-top: 0;
    }
}

/* Better touch targets for mobile */
button, .call-btn, .search-btn {
    min-height: 44px;
    min-width: 44px;
}

/* Improve tap highlighting */
* {
    -webkit-tap-highlight-color: rgba(52, 73, 115, 0.2);
}

/* Dodanie subtelnego wzoru w tle */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255,255,255,0.1) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 
        0 25px 50px rgba(52, 73, 115, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

header {
    background: linear-gradient(135deg, #344973 0%, #4a5e7c 50%, #5c7299 100%);
    color: white;
    text-align: center;
    padding: 40px 30px;
    position: relative;
    overflow: hidden;
}

/* Dodanie efektu świetlnego w nagłówku */
header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: headerGlow 8s ease-in-out infinite;
}

@keyframes headerGlow {
    0%, 100% { transform: rotate(0deg); opacity: 0.5; }
    50% { transform: rotate(180deg); opacity: 0.8; }
}

.logo-container {
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.header-logo {
    max-width: 300px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.05);
}

header h1 {
    font-size: 2.8em;
    font-weight: 300;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
}

.header-subtitle {
    font-size: 1.1em;
    opacity: 0.9;
    font-weight: 300;
    letter-spacing: 1px;
    position: relative;
    z-index: 2;
}

.search-section {
    padding: 40px 30px;
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid rgba(52, 73, 115, 0.1);
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.search-wrapper {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 16px;
    z-index: 2;
}

.search-input {
    width: 100%;
    padding: 18px 25px 18px 50px;
    border: 2px solid rgba(52, 73, 115, 0.2);
    border-radius: 15px;
    font-size: 16px;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(52, 73, 115, 0.1);
}

.search-input:focus {
    outline: none;
    border-color: #344973;
    box-shadow: 
        0 0 0 4px rgba(52, 73, 115, 0.1),
        0 4px 12px rgba(52, 73, 115, 0.2);
    transform: translateY(-2px);
}

.search-input:focus + .search-icon {
    color: #344973;
}

.search-btn {
    padding: 18px 35px;
    background: linear-gradient(135deg, #344973 0%, #4a5e7c 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(52, 73, 115, 0.3);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.search-btn::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;
}

.search-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(52, 73, 115, 0.4);
    background: linear-gradient(135deg, #2a3a5c 0%, #344973 100%);
}

.search-btn:hover::before {
    left: 100%;
}

.contacts-section {
    padding: 40px 30px;
    max-height: 700px;
    overflow-y: auto;
    background: linear-gradient(180deg, #fafbfc 0%, #f1f5f9 100%);
}

/* Stylizacja scrollbara */
.contacts-section::-webkit-scrollbar {
    width: 8px;
}

.contacts-section::-webkit-scrollbar-track {
    background: rgba(52, 73, 115, 0.1);
    border-radius: 4px;
}

.contacts-section::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #344973, #4a5e7c);
    border-radius: 4px;
}

.contacts-list {
    display: grid;
    gap: 25px;
}

.contact-card {
    background: white;
    border: 1px solid rgba(52, 73, 115, 0.1);
    border-radius: 18px;
    padding: 30px;
    box-shadow: 
        0 8px 25px rgba(52, 73, 115, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #344973, #4a5e7c);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 
        0 15px 35px rgba(52, 73, 115, 0.15),
        0 0 0 1px rgba(52, 73, 115, 0.1);
    border-color: rgba(52, 73, 115, 0.2);
}

.contact-card:hover::before {
    transform: scaleY(1);
}

.contact-info {
    flex: 1;
}

.contact-name {
    font-size: 1.4em;
    font-weight: 700;
    color: #344973;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-name i {
    color: #4a5e7c;
    font-size: 0.8em;
}

.contact-position {
    font-size: 1em;
    color: #6366f1;
    font-weight: 500;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact-position i {
    color: #8b5cf6;
    font-size: 0.9em;
}

.contact-phone {
    font-size: 1.2em;
    color: #4a5e7c;
    font-family: 'Courier New', monospace;
    margin-bottom: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-phone i {
    color: #10b981;
    font-size: 0.9em;
}

.contact-email {
    font-size: 1em;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-email i {
    color: #f59e0b;
    font-size: 0.8em;
}

.contact-actions {
    display: flex;
    gap: 15px;
}

.call-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.call-btn i {
    font-size: 1.1em;
}

.call-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.call-btn:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.call-btn:hover::after {
    width: 100px;
    height: 100px;
}

.loading, .error {
    text-align: center;
    padding: 50px;
    font-size: 1.3em;
    border-radius: 15px;
    margin: 20px;
}

.loading {
    color: #344973;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    border: 2px solid rgba(52, 73, 115, 0.1);
}

.error {
    color: #dc2626;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 2px solid #fecaca;
}

.no-results {
    text-align: center;
    padding: 60px;
    color: #64748b;
    font-size: 1.2em;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 15px;
    border: 2px dashed rgba(52, 73, 115, 0.2);
}

.no-results i {
    display: block;
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.7;
    color: #94a3b8;
}

/* Animacje */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: translateY(30px) scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

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

/* Mobile-first responsive design */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }
    
    .container {
        margin: 0;
        border-radius: 15px;
    }
    
    .search-section {
        flex-direction: column;
        padding: 20px 15px;
        gap: 15px;
    }
    
    .search-wrapper {
        min-width: auto;
        width: 100%;
    }
    
    .search-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 16px 20px 16px 45px;
    }
    
    .search-btn {
        width: 100%;
        justify-content: center;
        padding: 16px 20px;
    }
    
    .contact-card {
        flex-direction: column;
        text-align: left;
        gap: 15px;
        padding: 20px 15px;
        margin: 0 5px;
    }
    
    .contact-actions {
        justify-content: stretch;
        width: 100%;
    }
    
    .call-btn {
        width: 100%;
        justify-content: center;
        padding: 16px 20px;
        font-size: 16px;
    }
    
    header {
        padding: 25px 15px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .header-logo {
        max-width: 220px;
    }
    
    .contacts-section {
        padding: 20px 10px;
        max-height: calc(100vh - 400px);
    }
}

@media (max-width: 480px) {
    header {
        padding: 20px 10px;
    }
    
    header h1 {
        font-size: 1.7em;
    }
    
    .header-subtitle {
        font-size: 0.9em;
    }
    
    .contact-name {
        font-size: 1.1em;
    }
    
    .contact-phone {
        font-size: 1em;
    }
    
    .contact-email {
        font-size: 0.85em;
    }
    
    .contact-position {
        font-size: 0.9em;
    }
    
    .search-input {
        padding: 14px 18px 14px 40px;
    }
    
    .search-icon {
        left: 15px;
    }
}

/* Landscape mobile optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        border-radius: 10px;
    }
    
    header {
        padding: 15px 10px;
    }
    
    header h1 {
        font-size: 1.5em;
        margin-bottom: 5px;
    }
    
    .header-subtitle {
        font-size: 0.8em;
    }
    
    .header-logo {
        max-width: 180px;
        margin-bottom: 10px;
    }
    
    .contacts-section {
        max-height: calc(100vh - 200px);
        padding: 15px 10px;
    }
    
    .contact-card {
        padding: 15px;
        gap: 10px;
    }
}
