/* ==========================================================================
   GIGLAB CSS STYLING - VERZIJA 1.4.08
   ========================================================================== */

/* Osnovna resetovanja i mračna tema - UJEDNAČENI I TANKI FONTOVI GLOBALNO */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-weight: 300;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #0b0f19;
    color: #f8fafc;
    height: 100vh;
    overflow: hidden;
    font-size: 16px; /* Krupnija i gospodska slova po difoltu */
}

h1, h2, h3, h4 {
    font-weight: 300;
}

/* Kontejner aplikacije - Troslojni raspored (SPA layout) */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* ==========================================================================
   KOLONA 1: Glavni Sidebar (Navigacija, Bendovi, Korisnički Profil)
   ========================================================================== */
.sidebar {
    width: 250px;
    background-color: #111827;
    border-right: 1px solid #1f2937;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    z-index: 100;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
}

.sidebar-logo {
    font-size: 1.5em;
    font-weight: 400;
    color: #8b5cf6;
    letter-spacing: 1px;
    display: block;
}

.subtitle {
    font-size: 0.75em;
    color: #4b5563;
    margin-top: 3px;
}

.sidebar-divider {
    height: 1px;
    background-color: #1f2937;
    margin: 15px 0;
}

/* Navigacioni meni - Moji Bendovi */
.nav-menu {
    flex-grow: 1;
    padding: 0 15px;
    overflow-y: auto;
}

.sidebar-section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 5px;
}

.sidebar-section-title {
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #4b5563;
}

.btn-sidebar-add-plus {
    background: transparent;
    border: none;
    color: #8b5cf6;
    font-size: 1.1em;
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
}

.btn-sidebar-add-plus:hover {
    transform: scale(1.15);
    color: #a78bfa;
}

/* Sidebar bands lista sa podmenijem */
.sidebar-band-item-wrapper {
    margin-bottom: 6px;
    border-radius: 8px;
    overflow: hidden;
}

.sidebar-band-row {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: transparent;
    border-radius: 6px;
    color: #9ca3af;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.sidebar-band-row:hover {
    background-color: #1f2937;
    color: #f3f4f6;
}

.sidebar-band-item-wrapper.active .sidebar-band-row {
    color: #8b5cf6;
    background-color: rgba(139, 92, 246, 0.05);
}

.dot-icon {
    font-size: 0.6em;
    margin-right: 10px;
    color: #4b5563;
}

.sidebar-band-item-wrapper.active .dot-icon, .sidebar-band-row:hover .dot-icon {
    color: #8b5cf6;
}

.band-title-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95em;
}

/* Podmeni unutar Sidebara (Stablo bez trouglova) */
.sidebar-band-sub-menu {
    margin-left: 20px;
    margin-top: 4px;
    border-left: 1px solid #1f2937;
    padding-left: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sub-menu-item {
    padding: 8px 10px;
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 0.82em;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.sub-menu-item:hover, .sub-menu-item.active {
    color: #38bdf8;
    background-color: #1f2937;
}

/* Donji deo sidebara (Profil & Prijava - Giglist stil) */
.sidebar-footer {
    padding: 15px;
    background-color: #111827;
    position: relative;
}

.user-profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    user-select: none;
}

.user-profile-trigger:hover {
    background-color: #1f2937;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background-color: #8b5cf6;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    font-weight: bold;
    overflow: hidden;
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info-text {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-name {
    font-size: 0.9em;
    color: #f3f4f6;
}

.caret-icon {
    font-size: 0.7em;
    color: #4b5563;
}

/* Popup meni iznad profila */
.profile-popup-menu {
    position: absolute;
    bottom: 65px;
    left: 15px;
    right: 15px;
    background-color: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    padding: 5px;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.3);
    z-index: 110;
}

.popup-item {
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: #d1d5db;
    font-size: 0.85em;
    text-align: left;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.popup-item:hover {
    background-color: #374151;
    color: #fff;
}

.btn-popup-logout {
    color: #fca5a5;
}

.btn-popup-logout:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.sidebar-app-footer {
    margin-top: 15px;
    padding: 10px 5px 0 5px;
    font-size: 0.72em;
    color: #4b5563;
    line-height: 1.4;
    border-top: 1px solid #1f2937;
}

.support-link {
    cursor: pointer;
    margin-bottom: 4px;
    color: #8b5cf6;
    transition: color 0.2s ease;
}

.support-link:hover {
    color: #a78bfa;
}

/* ==========================================================================
   KOLONA 2: Repertoar / Lista Pesama (Središnji sloj)
   ========================================================================== */
.repertoire-column {
    width: 280px;
    background-color: #0b0f19;
    border-right: 1px solid #1f2937;
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    z-index: 90;
}

.search-container {
    padding: 15px;
    border-bottom: 1px solid #1f2937;
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    background-color: #111827;
    border: 1px solid #1f2937;
    border-radius: 8px;
    color: #f8fafc;
    outline: none;
    font-size: 0.85em;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    border-color: #8b5cf6;
}

.songs-title-container {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.songs-title {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #4b5563;
}

.btn-back-dash {
    background-color: #1f2937;
    color: #d1d5db;
    border: 1px solid #374151;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-back-dash:hover {
    background-color: #374151;
}

.songs-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px 15px;
}

.song-item {
    padding: 10px 12px;
    background-color: #111827;
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85em;
    color: #9ca3af;
}

.song-item:hover {
    background-color: #1f2937;
    color: #f3f4f6;
    transform: translateX(2px);
}

.song-item.active {
    background-color: #8b5cf6;
    color: #fff;
}

/* ==========================================================================
   KOLONA 3: Glavni Radni Prostor (Plejer, Mikseta, Ekran)
   ========================================================================== */
.workspace-container {
    flex-grow: 1;
    height: 100%;
    display: flex;
    overflow: hidden;
}

.workspace-wrapper {
    flex-grow: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
}

.band-dashboard {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.band-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1f2937;
    padding-bottom: 15px;
}

.btn-new-band-large {
    background-color: #8b5cf6;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.85em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-new-band-large:hover {
    background-color: #7c3aed;
}

/* ==========================================================================
   BANDS VIEW (Kartice po uzoru na giglist.no)
   ========================================================================== */
.band-card {
    background-color: #111827;
    border-radius: 12px;
    border: 1px solid #1f2937;
    display: flex;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.band-card-logo-box {
    width: 140px;
    background-color: #0b0f19;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #1f2937;
    padding: 15px;
    color: #4b5563;
    cursor: pointer;
    position: relative;
    text-align: center;
}

.band-card-logo-box:hover {
    background-color: #111827;
}

.band-logo-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #1f2937;
}

.band-logo-icon {
    font-size: 2em;
    margin-bottom: 5px;
}

.band-logo-text {
    font-size: 0.72em;
    color: #6b7280;
    margin-top: 5px;
}

.band-card-content {
    flex-grow: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.band-card-name {
    font-size: 1.3em;
    color: #f8fafc;
}

.band-badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-owner {
    background-color: rgba(234, 179, 8, 0.1);
    color: #eab308;
    border: 1px solid #eab308;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65em;
    font-weight: bold;
}

.badge-member {
    background-color: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
    border: 1px solid #9ca3af;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65em;
    font-weight: bold;
}

.band-card-owner-name {
    font-size: 0.8em;
    color: #6b7280;
}

.band-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.band-action-btn {
    background-color: #1f2937;
    color: #f3f4f6;
    border: none;
    border-radius: 6px;
    padding: 8px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.band-action-btn:hover {
    background-color: #374151;
    color: #8b5cf6;
}

.action-icon {
    font-size: 1.1em;
}

/* ==========================================================================
   PANEL ZA UPRAVLJANJE BENDOM (Novi bend, Podešavanja, Članovi)
   ========================================================================== */
.band-admin-section {
    background-color: #111827;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #1f2937;
    margin-top: 15px;
}

.band-admin-title {
    font-size: 1.05em;
    color: #8b5cf6;
    border-bottom: 1px solid #1f2937;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.input-grid-double {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 600px) {
    .input-grid-double {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.input-label {
    font-size: 0.78em;
    color: #6b7280;
}

.settings-input {
    width: 100%;
    padding: 8px 10px;
    background-color: #0b0f19;
    border: 1px solid #1f2937;
    border-radius: 6px;
    color: #f8fafc;
    outline: none;
    font-size: 0.9em;
}

.settings-input:focus {
    border-color: #8b5cf6;
}

.btn-connect {
    background-color: #8b5cf6;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.88em;
}

.btn-connect:hover {
    background-color: #7c3aed;
}

.btn-secondary {
    background-color: #1f2937;
    color: #f3f4f6;
    border: 1px solid #374151;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background-color: #374151;
}

.btn-stop {
    background-color: #ef4444;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-stop:hover {
    background-color: #dc2626;
}

/* ==========================================================================
   COMPACT MIKSETA (HORIZONTAL STRIPS - v1.3.7 STIL)
   ========================================================================== */
.mixer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    margin-top: 10px;
}

.track-strip {
    display: flex;
    align-items: center;
    background-color: #111827;
    border-radius: 8px;
    padding: 10px 15px;
    gap: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #1f2937;
    user-select: none;
}

.track-strip.dragging {
    opacity: 0.4;
    background-color: #1f2937;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.drag-handle {
    cursor: grab;
    font-size: 1.1em;
    color: #4b5563;
    user-select: none;
    padding: 0 3px;
}

.track-name {
    width: 140px;
    font-size: 0.9em;
    color: #d1d5db;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.volume-slider-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.volume-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: #1f2937;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
    cursor: pointer;
}

.btn-mute, .btn-solo {
    background-color: #1f2937;
    color: #9ca3af;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78em;
    padding: 6px 12px;
    transition: all 0.2s ease;
}

.btn-mute.active {
    background-color: #ef4444;
    color: #fff;
}

.btn-solo.active {
    background-color: #eab308;
    color: #111827;
}

/* ==========================================================================
   PLAYER STATUS CARD
   ========================================================================== */
.player-status-card {
    background-color: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.status-label {
    font-size: 0.85em;
    color: #9ca3af;
    margin-bottom: 12px;
    border-left: 3px solid #8b5cf6;
    padding-left: 10px;
}

.master-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.controls-buttons-group {
    display: flex;
    gap: 10px;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #0b0f19;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #1f2937;
}

.vol-slider {
    -webkit-appearance: none;
    width: 120px;
    height: 4px;
    background: #1f2937;
    border-radius: 2px;
    outline: none;
}

.vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    background: #8b5cf6;
    border-radius: 50%;
    cursor: pointer;
}

/* ==========================================================================
   PODEŠAVANJA MODAL
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.modal-content {
    background-color: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 20px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1f2937;
    padding-bottom: 10px;
}

.modal-title {
    font-size: 1.15em;
    font-weight: 300;
    color: #8b5cf6;
}

.modal-close-btn {
    font-size: 1.5em;
    cursor: pointer;
    color: #6b7280;
    background: transparent;
    border: none;
    outline: none;
}

.modal-close-btn:hover {
    color: #fff;
}

.modal-tabs {
    display: flex;
    border-bottom: 1px solid #1f2937;
    gap: 5px;
}

.modal-tab {
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 0.85em;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.modal-tab:hover {
    color: #d1d5db;
}

.modal-tab.active {
    color: #8b5cf6;
    border-bottom-color: #8b5cf6;
}

.modal-body {
    max-height: 350px;
    overflow-y: auto;
    padding: 5px 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #1f2937;
    padding-top: 10px;
}

/* ==========================================================================
   AUTENTIFIKACIJA PANELS
   ========================================================================== */
.auth-wrapper {
    width: 100%;
    max-width: 400px;
    background-color: #111827;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    margin: 80px auto;
    border: 1px solid #1f2937;
}

.lang-switch-container {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 15px;
}

.btn-lang {
    background-color: #1f2937;
    color: #9ca3af;
    border: 1px solid #374151;
    border-radius: 15px;
    padding: 3px 10px;
    font-size: 0.72em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-lang.active, .btn-lang:hover {
    background-color: #8b5cf6;
    color: #fff;
    border-color: #8b5cf6;
}

.auth-title {
    font-size: 1.3em;
    text-align: center;
    margin-bottom: 20px;
    color: #8b5cf6;
}

.auth-switch-link {
    text-align: center;
    font-size: 0.8em;
    color: #8b5cf6;
    cursor: pointer;
    margin-top: 15px;
    text-decoration: underline;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILNI PREKLAPAJUĆI KORACI)
   ========================================================================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 150;
}

.mobile-toggle-btn {
    display: none;
}

#mobileBackToSongsBtn {
    display: none;
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        z-index: 200;
        box-shadow: 5px 0 25px rgba(0,0,0,0.5);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .mobile-toggle-btn {
        display: inline-block;
        background-color: #1f2937;
        border: 1px solid #374151;
        color: #f3f4f6;
        border-radius: 6px;
        padding: 6px 12px;
        font-size: 0.8em;
        cursor: pointer;
    }

    .stems-player-container-responsive {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: 100%;
    }
    
    /* Default state: show repertoire, hide mixer */
    .stems-player-container-responsive #repertoireColumn {
        display: flex !important;
        width: 100% !important;
        height: 100% !important;
    }
    .stems-player-container-responsive .workspace-wrapper {
        display: none !important;
    }
    
    /* When song is loaded: hide repertoire, show mixer */
    .stems-player-container-responsive.song-loaded #repertoireColumn {
        display: none !important;
    }
    .stems-player-container-responsive.song-loaded .workspace-wrapper {
        display: flex !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    #mobileBackToSongsBtn {
        display: inline-block !important;
    }

    .track-strip {
        padding: 8px 10px;
        gap: 8px;
    }

    .track-name {
        width: 90px;
        font-size: 0.78em;
    }

    .btn-mute, .btn-solo {
        padding: 6px 8px;
        font-size: 0.72em;
    }
}

@media (min-width: 769px) {
    .stems-player-container-responsive {
        display: flex !important;
        flex-direction: row !important;
        width: 100%;
        height: 100%;
    }
    .stems-player-container-responsive #repertoireColumn {
        display: flex !important;
        width: 280px !important;
    }
    .stems-player-container-responsive .workspace-wrapper {
        display: flex !important;
        flex-grow: 1 !important;
    }
}
