/* ==========================================================================
   1. RESET I GŁÓWNE STYLE STRONY
   ========================================================================== */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: #05050c;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   2. EKRAN LOGOWANIA (ZABEZPIECZENIA)
   ========================================================================== */
.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    text-align: center;
}
.login-container h1 {
    font-size: 32px;
    color: #ff8c00;
    font-weight: 800;
    margin-bottom: 5px;
}
.login-box {
    background-color: #121225;
    padding: 40px;
    border-radius: 24px;
    width: 100%;
    max-width: 320px;
    border: 1px solid #222;
    box-sizing: border-box;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}
input[type="email"], input[type="text"] {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    text-align: center;
    border-radius: 10px;
    border: none;
    background: #222;
    color: #fff;
    margin-bottom: 15px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}
input[type="email"]:focus, input[type="text"]:focus {
    border: 1px solid #ff8c00;
}
.submit-btn {
    width: 100%;
    padding: 15px;
    background: #ff8c00;
    color: #000;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.submit-btn:hover {
    background: #ffaa33;
}
.error-alert {
    background-color: rgba(255, 68, 68, 0.1);
    border: 1px solid #ff4444;
    color: #ff4444;
    padding: 15px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 20px;
}

/* ==========================================================================
   3. GŁÓWNY UKŁAD (DASHBOARD)
   ========================================================================== */
.dashboard {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* --- LEWY PASEK BOCZNY (SIDEBAR) --- */
.sidebar {
    width: 270px;
    background-color: #090912;
    border-right: 1px solid #151525;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 30px 20px;
    box-sizing: border-box;
    flex-shrink: 0;
}
.sidebar-brand {
    font-size: 22px;
    color: #ff8c00;
    font-weight: 900;
    letter-spacing: 1px;
    margin-bottom: 40px;
    text-align: left;
    padding-left: 10px;
}
.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}
.menu-item {
    display: flex;
    align-items: center;
    color: #888;
    text-decoration: none;
    padding: 14px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    transition: 0.2s ease;
    cursor: pointer;
}
.menu-item:hover {
    background-color: #121225;
    color: white;
}
.menu-item.active {
    background-color: #ff8c00;
    color: black;
}

/* --- STOPKA SYGNATURY PROFILU --- */
.sidebar-footer {
    border-top: 1px solid #151525;
    padding-top: 25px;
    text-align: left;
    padding-left: 10px;
}
.user-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    justify-content: space-between;
}
.username {
    font-weight: bold;
    color: white;
    font-size: 15px;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- ODZNAKI (BADGES) --- */
.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #1d9bf0;
    color: white;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    font-size: 9px;
    font-weight: bold;
    margin-left: 6px;
    line-height: 14px;
    box-shadow: 0 0 5px rgba(29, 155, 240, 0.4);
}
.role-badge {
    display: inline-block;
    background: gold;
    color: black;
    padding: 2.5px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    margin-top: 4px;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

/* ==========================================================================
   4. PRAWA STRONA (GŁÓWNA ZAWARTOŚĆ I ZAKŁADKI)
   ========================================================================== */
.main-content {
    flex-grow: 1;
    padding: 40px;
    overflow-y: auto;
    text-align: left;
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}
.tab-content h2 {
    font-size: 28px;
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 800;
}
.tab-content p {
    color: #888;
    font-size: 15px;
    line-height: 1.6;
}

/* ==========================================================================
   5. KREATOR I TABLICA POSTÓW (FACEBOOK TIMELINE)
   ========================================================================== */
.fb-post-creator {
    background: #121225;
    border: 1px solid #222;
    border-radius: 20px;
    padding: 20px;
    max-width: 650px;
    margin-bottom: 30px;
    box-sizing: border-box;
}
.fb-post-creator h3 {
    margin-top: 0;
    color: #ff8c00;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}
.fb-textarea {
    width: 100%;
    height: 80px;
    background: #05050c;
    border: 1px solid #222;
    border-radius: 12px;
    color: white;
    padding: 15px;
    font-size: 15px;
    box-sizing: border-box;
    resize: none;
    outline: none;
    font-family: inherit;
}
.fb-creator-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}
.file-upload-btn {
    background: #1f1f38;
    color: #aaa;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    border: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.file-upload-btn:hover {
    background: #2a2a4d;
    color: #fff;
    border-color: #444;
}
.fb-submit-btn {
    padding: 10px 25px;
    background: #ff8c00;
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}
.fb-submit-btn:hover {
    background: #ffaa33;
}

/* --- KARTY POSTÓW --- */
.posts-timeline {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 650px;
}
.post-card {
    background: #121225;
    border: 1px solid #1c1c35;
    border-radius: 20px;
    padding: 20px;
    box-sizing: border-box;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}
.post-avatar {
    width: 40px;
    height: 40px;
    background: #ff8c00;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: #000;
    margin-right: 12px;
}
.post-meta {
    display: flex;
    flex-direction: column;
    text-align: left;
}
.post-author {
    font-size: 15px;
    font-weight: bold;
    color: #fff;
    display: flex;
    align-items: center;
}
.post-date {
    font-size: 12px;
    color: #555;
    margin-top: 3px;
}
.post-content {
    font-size: 15px;
    color: #ddd;
    line-height: 1.5;
    white-space: pre-wrap;
    margin-bottom: 15px;
}
.post-image {
    width: 100%;
    border-radius: 12px;
    max-height: 450px;
    object-fit: cover;
    border: 1px solid #222;
    margin-top: 5px;
}

/* ==========================================================================
   6. SIATKA UTWORÓW (SPOTIFY GRID)
   ========================================================================== */
.song-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin-top: 25px;
}
.song-card {
    background: #121225;
    border: 1px solid #1c1c35;
    border-radius: 16px;
    padding: 18px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.song-card:hover {
    transform: translateY(-3px);
    border-color: #ff8c00;
    box-shadow: 0 6px 15px rgba(255,140,0,0.15);
}
.song-card:active {
    background: #ff8c00;
}
.song-card:active .song-title, .song-card:active .song-subtitle {
    color: #000;
}
.song-card:active .song-icon {
    background: rgba(0,0,0,0.15);
    color: #000;
}
.song-icon {
    font-size: 20px;
    background: rgba(255, 140, 0, 0.1);
    color: #ff8c00;
    border-radius: 10px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}
.song-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.song-title {
    font-size: 14px;
    font-weight: bold;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.song-subtitle {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   7. TABELA LOGÓW (SZYBKI MONOSPACE)
   ========================================================================== */
.log-table {
    width: 100%;
    max-width: 900px;
    border-collapse: collapse;
    margin-top: 20px;
    font-family: 'SFMono-Regular', Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 13px;
    background: #090912;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #151525;
}
.log-table th, .log-table td {
    padding: 12px 16px;
    text-align: left;
}
.log-table th {
    background: #121225;
    color: #aaa;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.log-table tr {
    border-bottom: 1px solid #151525;
}
.log-table tr:last-child {
    border-bottom: none;
}
.log-success { color: #4caf50; }
.log-failed { color: #ff9800; }
.log-unauthorized { color: #f44336; }

/* ==========================================================================
   8. SEKCJA DOKUMENTACJI
   ========================================================================== */
.doc-section {
    background: #121225;
    padding: 25px;
    border-radius: 16px;
    max-width: 800px;
    border: 1px solid #222;
    margin-bottom: 25px;
}
.doc-section h3 {
    margin-top: 0;
    color: #ff8c00;
    font-size: 18px;
}
.doc-code {
    background: #05050c;
    padding: 12px;
    border-radius: 8px;
    font-family: monospace;
    display: block;
    margin: 10px 0;
    color: #1d9bf0;
    font-size: 14px;
}

/* ==========================================================================
   9. ELEMENTY GLOBALNE (TOAST / OVERLAY)
   ========================================================================== */
#overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5,5,12,0.98);
    z-index: 1000;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
}
#overlay h1 {
    color: #ff4444;
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 10px;
}
#overlay p {
    color: #888;
    font-size: 16px;
}
#toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 16px;
    position: fixed;
    z-index: 999;
    left: 50%;
    transform: translateX(-50%);
    top: -100px;
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s, top 0.3s;
}
#toast.show {
    visibility: visible;
    opacity: 1;
    top: 50px;
}
#toast.success {
    background-color: #4caf50;
}
/* ==========================================================================
   10. ZAJEBISTA STOPKA (FOOTER)
   ========================================================================== */
.main-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 30px;
    margin-top: 60px;
    border-top: 1px solid #151525;
    color: #444;
    font-size: 13px;
    max-width: 1100px;
    box-sizing: border-box;
}
.main-footer b {
    color: #ff8c00;
}
.footer-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Zielona dioda statusu */
.status-dot {
    width: 8px;
    height: 8px;
    background-color: #4caf50;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
    animation: pulse-green 2s infinite;
}
.status-text {
    color: #666;
    font-weight: bold;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.version-badge {
    background: #121225;
    color: #666;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    border: 1px solid #222;
}

/* Animacja pulsowania diody */
@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(76, 175, 80, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}