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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

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

/* Navbar */
nav {
    background: #2c3e50;
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

nav .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1rem;
    align-items: center;
}

nav ul li a,
nav ul li button {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
}

nav ul li a:hover,
nav ul li button:hover {
    background: rgba(255, 255, 255, 0.1);
}

nav button:hover {
    color: #e74c3c;
}

nav button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.3s;
}

nav a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

nav a:hover {
    color: #3498db;
}

nav .username {
    color: #3498db;
    font-weight: bold;
    padding: 0.5rem 1rem;
}

/* Hamburger button (ukryty na desktop) */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s;
}

/* Dropdown menu styles (desktop only) */
@media (min-width: 769px) {
    nav .dropdown {
        position: relative;
    }

    nav .dropdown-toggle {
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }

    nav .dropdown-toggle .arrow {
        font-size: 0.7rem;
        transition: transform 0.3s;
    }

    nav .dropdown:hover .dropdown-toggle .arrow {
        transform: rotate(180deg);
    }

    nav .dropdown-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        background: #34495e;
        min-width: 200px;
        border-radius: 4px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.3);
        padding: 0.5rem 0;
        margin-top: 0.25rem;
        z-index: 1000;
        opacity: 0;
        transition: opacity 0.2s ease-in-out;
        pointer-events: none;
    }

    /* Dodaj padding-top aby stworzyć "most" między głównym elementem a menu */
    nav .dropdown-menu::before {
        content: '';
        position: absolute;
        top: -0.25rem;
        left: 0;
        right: 0;
        height: 0.25rem;
    }

    nav .dropdown:hover .dropdown-menu {
        display: block;
        opacity: 1;
        pointer-events: auto;
        transition-delay: 0s;
    }

    /* Opóźnienie przed ukryciem menu */
    nav .dropdown .dropdown-menu {
        transition-delay: 0s;
    }

    nav .dropdown:not(:hover) .dropdown-menu {
        transition-delay: 0.15s;
    }

    nav .dropdown-menu li {
        display: block;
    }

    nav .dropdown-menu li a {
        display: block;
        padding: 0.75rem 1rem;
        color: white;
        text-decoration: none;
        border-radius: 0;
        transition: background 0.3s;
    }

    nav .dropdown-menu li a:hover {
        background: rgba(255, 255, 255, 0.15);
    }
}

/* Main content */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 180px);
}

h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.welcome {
    color: #7f8c8d;
    margin-bottom: 2rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.stat {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.stat:last-child {
    border-bottom: none;
}

.stat-label {
    color: #7f8c8d;
}

.stat-value {
    font-weight: 600;
    color: #2c3e50;
}

.progress-bar {
    background: #e0e0e0;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    transition: width 0.3s;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.action-btn {
    display: block;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
}

.action-btn:hover {
    transform: translateY(-2px);
}

#install-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 3rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    /* Pokaż hamburger */
    .hamburger {
        display: flex;
    }

    /* Ukryj menu domyślnie */
    nav .nav-menu {
        position: fixed;
        left: -100%;
        top: 0;
        margin-top: 60px;
        flex-direction: column;
        background-color: #2c3e50;
        width: 100%;
        text-align: left;
        transition: left 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 0;
        gap: 0;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        z-index: 99;
    }

    /* Menu aktywne */
    nav .nav-menu.active {
        left: 0;
    }

    /* Elementy menu */
    nav .nav-menu li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    nav .nav-menu li a,
    nav .nav-menu li button {
        width: 100%;
        text-align: left;
        padding: 1rem 1.5rem;
        border-radius: 0;
        display: block;
    }

    nav .nav-menu li form {
        width: 100%;
    }

    .user-info {
        background: rgba(52, 152, 219, 0.1);
        padding: 1rem 1.5rem;
    }

    .username {
        display: block;
        padding: 0;
    }

    /* Dropdown menus on mobile */
    nav .dropdown {
        position: relative;
    }

    nav .dropdown-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    nav .dropdown-toggle .arrow {
        font-size: 0.7rem;
        transition: transform 0.3s;
        margin-left: auto;
    }

    nav .dropdown-menu {
        display: none;
        background: rgba(0, 0, 0, 0.2);
        padding: 0;
        margin: 0;
        list-style: none;
    }

    nav .dropdown-menu li {
        border-bottom: none;
        padding-left: 1rem;
    }

    nav .dropdown-menu li a {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }

    /* Animacja hamburger → X */
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}

/* Tablet */
@media (max-width: 1024px) and (min-width: 769px) {
    nav ul {
        gap: 0.5rem;
    }

    nav ul li a,
    nav ul li button {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}
/* Touch-friendly buttons */
@media (hover: none) {
    button, a {
        min-height: 44px; /* Apple's recommended touch target */
        min-width: 44px;
    }
}

/* Menu icons */
.menu-icon {
    display: inline;
    margin-right: 0.5rem;
}

/* Language Switcher */
.language-switcher {
    list-style: none;
}

.lang-btn {
    background: none;
    border: 2px solid transparent;
    padding: 0.35rem 0.5rem;
    font-size: 1.3rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1;
}

.lang-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    transform: scale(1.1);
}

.lang-btn.active {
    background: rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

/* Mobile adjustments for language switcher */
@media (max-width: 768px) {
    .language-switcher {
        display: flex;
        justify-content: center;
        padding: 0.75rem 0;
        border-top: 1px solid #e1e8ed;
        margin-top: 0.5rem;
    }

    .lang-btn {
        font-size: 1.5rem;
        padding: 0.5rem 0.75rem;
    }
}