/* Reset i główny układ */
body {
    margin: 0;
    padding: 0;
    height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    background-color: #f5f5f7; /* Tło przypominające macOS */
    color: #1d1d1f;
    overflow: hidden;
}

/* --- LEWY PANEL (SIDEBAR) --- */
.macos-sidebar {
    width: 250px;
    background-color: rgba(236, 236, 236, 0.8);
    backdrop-filter: blur(20px); /* Efekt rozmycia szkła z macOS */
    border-right: 1px solid #d2d2d7;
    display: flex;
    flex-direction: column;
    padding: 15px 10px;
    box-sizing: border-box;
    z-index: 100;
}

.sidebar-brand {
    font-weight: 600;
    font-size: 14px;
    color: #86868b;
    padding: 0 12px 10px 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Wyrównanie kontenera */
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start; 
}

/* Skalowanie grafiki */
.sidebar-brand .sidebar-logo {
    max-height: 28px;    
    max-width: 100%;     
    width: auto;         
    object-fit: contain;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    color: #1d1d1f;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: background 0.1s, color 0.1s;
}

.menu-item i {
    width: 24px;
    font-size: 16px;
    text-align: center;
    margin-right: 8px;
    color: #007aff; /* Niebieskie ikony w stylu Apple */
}

.menu-item:hover {
    background-color: #e8e8ed;
    text-decoration: none;
    color: #1d1d1f;
}

/* Aktywny element menu */
.menu-item.active {
    background-color: #007aff;
    color: #ffffff;
}

.menu-item.active i {
    color: #ffffff;
}

/* Dolna sekcja menu (linki zewnętrzne i wyloguj) */
.sidebar-bottom {
    border-top: 1px solid #d2d2d7;
    padding-top: 10px;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-item.external i { color: #86868b; }
.menu-item.logout i { color: #ff3b30; } /* Czerwony akcent dla wylogowania */

/* --- GŁÓWNA ZAWARTOŚĆ --- */
.macos-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border-radius: 10px 0 0 10px; /* Zaokrąglenie lewej krawędzi okna */
    margin-top: 10px;
    margin-bottom: 10px;
    box-shadow: -2px 0 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

/* Sub-layout dla ChatSMS (lista z lewej, czat z prawej) */
.chat-layout {
    display: flex;
    height: 100%;
}

.chat-list {
    width: 300px;
    border-right: 1px solid #e5e5ea;
    background-color: #fafafa;
    display: flex;
    flex-direction: column;
}

.chat-window {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
}

/* Nagłówki sekcji (Toolbar) */
.macos-toolbar {
    height: 50px;
    border-bottom: 1px solid #e5e5ea;
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.9);
}

/* --- ANIMACJE I PŁYNNE PRZEJŚCIA --- */
body {
    opacity: 0;
    transition: opacity 0.25s ease-in-out;
}

body.page-loaded {
    opacity: 1;
}

.fade-in-content {
    animation: macosFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes macosFadeIn {
    from {
        opacity: 0;
        transform: scale(0.98) translateY(6px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* --- EKRAN LOGOWANIA (macOS Style) --- */
.login-wrapper {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 30%, #e0e5ff, #f5f5f7);
}

.login-card {
    width: 360px;
    padding: 35px 30px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.login-avatar {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 15px auto;
}

.login-card .form-control {
    border-radius: 8px;
    border: 1px solid #d2d2d7;
    background: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    padding: 10px 12px;
}

.login-card .form-control:focus {
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.25);
    border-color: #007aff;
}

.login-card .btn-primary {
    border-radius: 8px;
    background-color: #007aff;
    border: none;
    font-weight: 500;
    padding: 10px;
    transition: all 0.2s;
}

.login-card .btn-primary:hover {
    background-color: #0062cc;
    transform: translateY(-1px);
}

/* --- UJEDNOLICENIE FORMULARZY MACOS --- */
.form-control, 
input[type="text"], 
input[type="password"], 
input[type="date"], 
select, 
textarea {
    border-radius: 8px !important;
    border: 1px solid #d2d2d7 !important;
    background-color: rgba(255, 255, 255, 0.85) !important;
    color: #1d1d1f !important;
    font-size: 13px !important;
    padding: 6px 10px !important;
    transition: border-color 0.15s, box-shadow 0.15s !important;
}

.form-control:focus, 
input:focus, 
select:focus, 
textarea:focus {
    background-color: #ffffff !important;
    border-color: #007aff !important;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.25) !important;
    outline: none !important;
}

/* Stylizacja specyficzna dla kalendarza i wyboru daty */
input[type="date"] {
    position: relative;
    color: #1d1d1f;
}

/* Dymki czatu w oknie SMS */
.chat-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 16px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}

.chat-bubble.sent {
    background-color: #007aff;
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-bubble.received {
    background-color: #e5e5ea;
    color: #000000;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

/* Klasa dla elementów w budowie */
.menu-item.wip {
    color: #a1a1aa !important; /* Zgaszony, szary kolor */
    font-style: italic;        /* Kursywa */
    opacity: 0.6;              /* Lekka przezroczystość */
    transition: all 0.2s ease-in-out;
}

/* Lekkie podświetlenie po najechaniu, żeby klient widział, że są klikalne */
.menu-item.wip:hover {
    opacity: 1;
    color: #71717a !important; 
    cursor: pointer;
}

.login-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain; 
    border-radius: 50%;  
}
