/* style.css */

/* Reset i podstawowy układ pionowy */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f4f7f6;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- GÓRA STRONY (TOP HEADER) --- */
#page-header {
    background-color: #ffffff;
    padding: 15px 30px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.logo-container img {
    max-height: 60px;
    width: auto;
    display: block;
}
.logo-placeholder {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    letter-spacing: 1px;
}
.header-slogan {
    font-style: italic;
    color: #7f8c8d;
    font-size: 14px;
}

/* --- ŚRODEK STRONY (TRZY KOLUMNY) --- */
.app-layout {
    display: grid;
    grid-template-columns: 240px 1fr 240px;
    flex: 1;
}

.sidebar-left {
    background-color: #2c3e50;
    color: white;
    padding: 25px 15px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}
.sidebar-right {
    background-color: #ffffff;
    color: #333;
    padding: 25px 15px;
    border-left: 1px solid #e2e8f0;
    box-shadow: -2px 0 10px rgba(0,0,0,0.02);
}

.sidebar-left h2, .sidebar-right h2 {
    font-size: 18px;
    margin-bottom: 20px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    text-align: center;
}
.sidebar-left h2 { color: #ecf0f1; }
.sidebar-right h2 { color: #2c3e50; }

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-menu li { margin-bottom: 12px; }
.sidebar-menu a {
    display: block;
    color: #bdc3c7;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.2s ease;
}
.sidebar-menu a:hover {
    background-color: #34495e;
    color: white;
    padding-left: 20px;
}
.sidebar-menu a.active {
    background-color: #3498db;
    color: white;
}

.company-info {
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
    margin-bottom: 30px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.main-content { padding: 20px; }
.container {
    max-width: 800px;
    margin: 0 auto;
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
h1, h2, h3 { text-align: center; color: #2c3e50; }

/* Kalendarz i formularze */
#calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin: 20px 0; }
.calendar-header { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-weight: bold; color: #7f8c8d; margin-bottom: 5px; }
.day { background: #ecf0f1; padding: 15px; text-align: center; border-radius: 4px; cursor: pointer; font-weight: bold; transition: all 0.2s; }
.day:hover { background: #3498db; color: white; }
.day.selected { background: #2ecc71 !important; color: white; }
#order-form { display: none; margin-top: 30px; padding-top: 20px; border-top: 2px solid #ecf0f1; }
.form-group { margin-bottom: 15px; }
label { display: block; margin-bottom: 5px; font-weight: bold; color: #34495e; }
input[type="text"], input[type="tel"], input[type="number"], input[type="time"], select { width: 100%; padding: 10px; border: 1px solid #bdc3c7; border-radius: 4px; box-sizing: border-box; font-size: 16px; transition: border-color 0.2s, background-color 0.2s; }
button { width: 100%; padding: 12px; background: #2ecc71; border: none; color: white; font-size: 18px; font-weight: bold; border-radius: 4px; cursor: pointer; transition: background 0.2s; }
button:hover { background: #27ae60; }
#zajete-godziny-alert { margin: 15px 0; padding: 12px; background: #f8f9fa; border-left: 4px solid #3498db; color: #333; font-size: 15px; line-height: 1.5; }

/* Magazyn */
.magazyn-container { margin-top: 40px; padding-top: 20px; border-top: 2px solid #ecf0f1; }
.magazyn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 15px; margin-top: 20px; }
.magazyn-item { background: #f8f9fa; border: 1px solid #e2e8f0; border-radius: 8px; padding: 15px; text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,0.03); }

/* --- DÓŁ STRONY (BOTTOM FOOTER) --- */
#page-footer {
    background-color: #2c3e50;
    color: #bdc3c7;
    padding: 20px 30px;
    border-top: 3px solid #3498db;
    font-size: 14px;
}
.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 15px;
}
.footer-copyright a { color: #ffffff; text-decoration: none; font-weight: bold; }
.footer-admin a {
    color: #e74c3c;
    text-decoration: none;
    font-weight: bold;
    background: #34495e;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}
.footer-admin a:hover { background: #c0392b; color: #ffffff; }

/* --- NOWE: STYL DLA TABELI CENNIKA --- */
.cennik-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 16px;
}
.cennik-table th {
    background-color: #2c3e50;
    color: white;
    text-align: left;
    padding: 12px 15px;
}
.cennik-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
}
.cennik-table tr:nth-child(even) {
    background-color: #f8f9fa;
}
.cennik-cena {
    text-align: right;
    color: #27ae60;
    font-weight: bold;
}

/* --- STYLE RESPONSYWNE DLA SMARTFONÓW --- */
@media (max-width: 1024px) {
    #page-header { flex-direction: column; gap: 5px; text-align: center; }
    .app-layout { grid-template-columns: 1fr; }
    .sidebar-left { padding: 15px; }
    .sidebar-menu { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
    .sidebar-menu li { margin-bottom: 0; }
    .sidebar-right { border-left: none; border-top: 2px solid #ecf0f1; }
    .main-content { padding: 10px; }
    .container { padding: 15px; }
    #calendar, .calendar-header { gap: 4px; }
    .day { padding: 10px 2px; font-size: 13px; }
    .magazyn-grid { grid-template-columns: 1fr; gap: 10px; }
    #page-footer { text-align: center; }
    .footer-container { flex-direction: column; gap: 10px; }
    
    /* DODATEK: Optymalizacja tabeli cennika na telefonach */
    .cennik-table { font-size: 14px; }
    .cennik-table th, .cennik-table td { padding: 10px 8px; }
    .cennik-cena { white-space: nowrap; }
}

/* --- WIZUALNA WALIDACJA POLA TELEFONU --- */
#telefon:focus {
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

/* Zmiana koloru obwódki na czerwoną, gdy skrypt JS wykryje błąd (przypisanie stylu border-color) */
#telefon[style*="border-color: rgb(192, 57, 43)"],
#telefon[style*="border-color: #c0392b"] {
    background-color: #fdf2f2;
}