/* ----------------------------------------------------------
   Osnovni stilovi
---------------------------------------------------------- */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: #f2f2f2;
}

/* ----------------------------------------------------------
   Header + Navigacija
---------------------------------------------------------- */
.app-header {
    background: #1e3a5f;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-menu {
    display: flex;
    gap: 15px;
}

.nav-btn {
    background: #2d5a88;
    padding: 10px 18px;
    border-radius: 6px;
    color: white;
    text-decoration: none;
    font-weight: bold;
}

.nav-btn:hover {
    background: #3c6fa8;
}

.logout {
    background: #b83232;
}

.logout:hover {
    background: #d64545;
}

.app-main {
    padding-left: 30px;
    padding-right: 30px;
}

.auto-badge {
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: bold;
    display: inline-block;
}



/* ----------------------------------------------------------
   Glavni sadržaj
---------------------------------------------------------- */
.app-main {
    padding: 30px;
}

/* ----------------------------------------------------------
   Kartice
---------------------------------------------------------- */
.card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 1200px;
    margin: auto;
}

.card h2 {
    margin-top: 0;
    margin-bottom: 20px;
}

/* ----------------------------------------------------------
   Responsive wrapper za tabelu
---------------------------------------------------------- */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 10px;
}

/* ----------------------------------------------------------
   Tablica streamera
---------------------------------------------------------- */
.streamer-table {
    width: 100%;
    border-collapse: collapse;
    background: white;

    /* FIX: tabela sada stane u karticu */
    min-width: 700px;
}

.streamer-table th {
    background: #1e3a5f;
    color: white;
    padding: 12px;
    text-align: left;
    white-space: nowrap;
}

.streamer-table td {
    padding: 10px;
    border-bottom: 1px solid #ccc;
    transition: background 0.3s ease;

    /* FIX: dozvoli prelamanje dugih ID-ova */
    white-space: normal;
    word-break: break-word;
}

/* Offline redovi */
.streamer-table tr.offline-row {
    background: #e6e6e6 !important;
    color: #555;
}

.streamer-table tr:hover {
    background: #eef3f8;
}

/* ----------------------------------------------------------
   Responsive min-width kolona (OPTIMIZIRANO)
---------------------------------------------------------- */
.streamer-table td:nth-child(1) { min-width: 120px; }
.streamer-table td:nth-child(2) { min-width: 100px; }
.streamer-table td:nth-child(3) { min-width: 150px; }
.streamer-table td:nth-child(4) { min-width: 90px; }
.streamer-table td:nth-child(5) { min-width: 90px; }
.streamer-table td:nth-child(6) { min-width: 100px; }
.streamer-table td:nth-child(7) { min-width: 100px; }
.streamer-table td:nth-child(8) { min-width: 130px; }

/* ----------------------------------------------------------
   Status oznake (BADGES)
---------------------------------------------------------- */
.status-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: bold;
    color: white;

    display: inline-flex;
    align-items: center;
    gap: 8px;

    border: 1px solid rgba(0,0,0,0.25);

    min-width: 90px;
    justify-content: center;
    text-align: center;

    /* FIX: spriječi prelamanje badgeova */
    white-space: nowrap;
}

.status-badge::before {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(255,255,255,0.9);
}

/* Badge boje */
.status-online { background: #5cb85c; }
.status-online::before { background: #3e8e3e; }

.status-offline { background: #b83232; }
.status-offline::before { background: #8a2525; }

.status-onair { background: #d9534f; }
.status-onair::before { background: #b52f2b; }

.status-offair { background: #5bc0de; }
.status-offair::before { background: #3a9ab8; }

.status-unknown { background: #777; }
.status-unknown::before { background: #555; }

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}
.status-onair { animation: blink 1s infinite; }

/* ----------------------------------------------------------
   Gumbi u tablici
---------------------------------------------------------- */
.table-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: white;
    font-weight: bold;

    width: 70px;
    text-align: center;

    /* FIX: spriječi prelamanje dugmadi */
    white-space: nowrap;
}

.start-btn { background: #2d8a34; }
.start-btn:hover { background: #37a03f; }

.stop-btn { background: #b83232; }
.stop-btn:hover { background: #d64545; }

/* ----------------------------------------------------------
   Link badgeovi
---------------------------------------------------------- */
.table-link {
    display: inline-block;
    padding: 4px 10px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    color: #1e3a5f;
    border: 1px solid #1e3a5f;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.2s ease-in-out;

    min-width: 100px;
    text-align: center;

    /* FIX: spriječi prelamanje linkova */
    white-space: nowrap;
}

.table-link:hover {
    background-color: #1e3a5f;
    color: white;
}

/* ----------------------------------------------------------
   LOGIN STRANICA
---------------------------------------------------------- */
.login-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 60px;
}

.card.login-card {
    width: 100%;
    max-width: 400px;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    background: white;
}

.login-title {
    text-align: center;
    margin-bottom: 25px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

.login-btn:hover {
    background: #0056b3;
}

.error {
    color: red;
    text-align: center;
    margin-top: 15px;
    font-weight: bold;
}

/* ----------------------------------------------------------
   SATOVI NA ZAGLAVLJU
---------------------------------------------------------- */
@font-face {
    font-family: 'DSDigital';
    src: url('fonts/DS-DIGII.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
}

#studio-clock {
    background: #000;
    padding: 12px 25px;
    border-bottom: 2px solid #222;

    /* OGRANIČAVAMO ŠIRINU I CENTRIRAMO */
    max-width: 600px;
    margin: 0 30px;
}

/* FLEKSIBILNI GRID — BEZ FIKSNIH ŠIRINA */
.clock-row {
    display: grid;
    grid-template-columns: auto auto auto 1fr;
    align-items: center;
    gap: 20px;
    margin-bottom: 8px;
}

/* TEKSTOVI */
.clock-label {
    color: #ccc;
    font-size: 24px;
    font-family: Arial, sans-serif;
    font-weight: bold;
	width: 100px;
}

.clock-day,
.clock-date,
.clock-time {
    font-family: 'DSDigital', monospace;
    font-size: 42px;
    color: #ff2a2a;
    text-shadow: 0 0 2px #ff0000, 0 0 4px #ff0000;
}

/* UKLANJAMO FIKSNE ŠIRINE */
.clock-day { width: 80px; }
.clock-date { width: 150px; }
.clock-time {
    width: 160px;
    letter-spacing: 2px;
}

.blink {
    opacity: 0;
}
