/* ============================================================
   Od srca do srca — Radio Banovina
   Glavni stilovi (izvučeno iz index.html)
   ============================================================ */

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.main-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.template-card {
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 1.5rem;
    margin: 1rem 0;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.template-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.template-card.selected {
    border-color: #667eea;
    background: #f8f9ff;
}

.form-section {
    background: #f8f9ff;
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
    border: 2px solid #667eea;
}

.preview-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1rem 0;
    border-left: 4px solid #28a745;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    padding: 0.75rem 2rem;
    font-weight: 500;
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    border-radius: 10px;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
}

pre {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.template-input {
    border: 2px dashed #007bff !important;
    background-color: #f8f9ff !important;
    font-weight: bold;
    text-align: center;
}

.template-input:focus {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

.card {
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.wish-card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Floating popup za status želja */
.floating-wishes-status {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    font-weight: bold;
    font-size: 14px;
    max-width: 200px;
    text-align: center;
}

.floating-wishes-status.show {
    opacity: 1;
    visibility: visible;
}

.floating-wishes-status:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.floating-wishes-status.pulse {
    animation: pulse 0.6s ease-in-out;
}

.floating-wishes-status.bounce {
    animation: bounce 0.8s ease-in-out;
}

@keyframes pulse {
    0% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.15); }
    100% { transform: translateY(-50%) scale(1); }
}

@keyframes bounce {
    0% { transform: translateY(-50%) scale(1); }
    15% { transform: translateY(-50%) scale(1.2); background: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%); }
    30% { transform: translateY(-50%) scale(0.9); }
    45% { transform: translateY(-50%) scale(1.1); }
    60% { transform: translateY(-50%) scale(1); }
    75% { transform: translateY(-50%) scale(1.05); }
    100% { transform: translateY(-50%) scale(1); background: linear-gradient(135deg, #28a745 0%, #20c997 100%); }
}

.floating-wishes-status .number {
    font-size: 18px;
    font-weight: bold;
    display: block;
}

.floating-wishes-status .text {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
}

.floating-wishes-status .novo-text {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff6b6b;
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.floating-wishes-status.show-novo .novo-text {
    opacity: 1;
}

/* Loading spinner animacija */
.fa-spinner {
    animation: fa-spin 1s infinite linear;
}

@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Audio Preview Stilovi - kompaktni dizajn */
.song-item {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    margin: 1px 0;
    border-radius: 4px;
    background: white;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
    min-height: 26px;
    max-height: 40px;
}

@media (max-width: 768px) {
    .song-item {
        padding: 4px 10px;
        min-height: 26px;
        max-height: 40px;
        margin: 1px 0;
    }

    .song-title {
        font-size: 0.85rem;
        line-height: 1.2;
    }
}

@media (hover: none) and (pointer: coarse) {
    .song-item {
        padding: 4px 10px;
        min-height: 26px;
        max-height: 40px;
        margin: 1px 0;
    }
}

.song-item:hover {
    background: #f8f9ff;
    border-color: #667eea;
    cursor: pointer;
}

.song-item.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.song-title {
    flex: 1;
    margin-right: 6px;
    font-size: 0.85rem;
    line-height: 1.2;
    max-width: 280px;
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

@media (max-width: 768px) {
    .song-title {
        font-size: 0.8rem !important;
        max-width: calc(100vw - 90px) !important;
        margin-right: 8px !important;
        -webkit-line-clamp: 2 !important;
        line-height: 1.2 !important;
        word-break: break-word !important;
        overflow: hidden !important;
        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
    }
}

@media (max-width: 480px) {
    .song-title {
        font-size: 0.75rem !important;
        max-width: calc(100vw - 80px) !important;
        margin-right: 5px !important;
        -webkit-line-clamp: 2 !important;
        line-height: 1.2 !important;
        word-break: break-word !important;
        overflow: hidden !important;
        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
    }
}

.preview-btn {
    background: none;
    border: 1px solid #667eea;
    color: #667eea;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.75rem;
    margin-left: auto;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .preview-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
        border-width: 1px;
        padding: 4px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .preview-btn {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
        border-width: 1px;
        min-width: 30px;
        min-height: 30px;
        padding: 5px;
    }
}

@media (max-width: 400px) {
    .preview-btn {
        width: 26px !important;
        height: 26px !important;
        font-size: 0.7rem !important;
        padding: 3px !important;
    }
}

.preview-btn:hover {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
    transform: scale(1.05);
}

.preview-btn.playing {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
    animation: pulse-audio 1.5s infinite;
}

.preview-btn.playing:hover {
    background-color: #c82333;
    border-color: #c82333;
}

.preview-btn.loading {
    background-color: #ffc107;
    color: white;
    border-color: #ffc107;
}

@keyframes pulse-audio {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Dropdown za pjesme s preview gumbovima */
.song-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: -50px;
    min-width: 400px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-height: 400px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1000;
    display: none;
}

@media (max-width: 768px) {
    .song-suggestions {
        left: -5px;
        right: -5px;
        min-width: auto;
        max-width: 95vw;
        max-height: 300px;
        font-size: 0.9rem;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: auto;
    }
}

@media (max-width: 480px) {
    .song-suggestions {
        left: -10px;
        right: -10px;
        max-width: calc(100vw - 60px);
        border-radius: 8px;
        max-height: 280px;
        width: auto;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 360px) {
    .song-suggestions {
        left: -20px;
        right: -20px;
        max-width: calc(100vw - 40px);
    }
}

.song-suggestions.show {
    display: block;
}

.song-input-container {
    position: relative;
}

@media (max-width: 768px) {
    .song-input-container {
        overflow: visible;
        width: 100%;
    }
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-radius: 50%;
    border-top: 2px solid #667eea;
    animation: spin 1s linear infinite;
    margin-left: 5px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Poboljšanja za poruke */
.alert {
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.alert-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
}

.alert-danger {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    color: white;
    border: none;
}

/* Draft restore modal (novo) */
.draft-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.draft-modal {
    background: white;
    border-radius: 14px;
    max-width: 460px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}

.draft-modal h4 {
    margin-top: 0;
    color: #333;
}

.draft-modal .draft-info {
    background: #f8f9ff;
    border-left: 4px solid #667eea;
    padding: 12px;
    border-radius: 6px;
    margin: 12px 0 20px;
    font-size: 0.95rem;
}

.draft-modal .actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
