/* User Authentication Styles */

/* Login Button */
.user-login-btn {
    background: linear-gradient(135deg, #991b1e 0%, #7a1518 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(153, 27, 30, 0.3);
    white-space: nowrap;
    height: fit-content;
}

.user-login-btn:hover {
    box-shadow: 0 4px 12px rgba(153, 27, 30, 0.5);
    background: linear-gradient(135deg, #b02226 0%, #991b1e 100%);
}

/* Notifications Wrapper */
#notifications-wrapper {
    position: relative;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hide notifications on mobile - show in hamburger menu instead */
@media (max-width: 768px) {
    #notifications-wrapper {
        display: none !important;
    }
}

.notifications-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.notifications-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.notifications-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e74c3c;
    color: white;
    border-radius: 10px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 0 6px;
    border: 2px solid #1a1a1a;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Notifications Dropdown */
.notifications-dropdown {
    position: fixed;
    /* Remove default positioning - will be set by JS */
    top: auto;
    left: auto;
    right: auto;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    min-width: 350px;
    max-width: 400px;
    max-height: 500px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    /* Remove animation that might cause visual jump */
    /* animation: dropdownFadeIn 0.2s ease; */
    overflow: hidden;
    display: none;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.1s ease;
}

.notifications-dropdown-header {
    padding: 16px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notifications-dropdown-header h3 {
    color: white;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.notifications-mark-all-read {
    background: transparent;
    border: none;
    color: #4a90e2;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.notifications-mark-all-read:hover {
    background: rgba(74, 144, 226, 0.1);
}

.notifications-dropdown-footer {
    padding: 12px 16px;
    border-top: 1px solid #333;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    /* Ensure footer stays at bottom */
    margin-top: auto;
}

.notifications-delete-read {
    background: transparent;
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s;
    width: 100%;
}

.notifications-delete-read:hover {
    background: rgba(231, 76, 60, 0.1);
    border-color: rgba(231, 76, 60, 0.5);
}

.notifications-list {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    /* Ensure scroll works properly */
    -webkit-overflow-scrolling: touch;
}

.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid #252525;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.notification-item:hover {
    background: #252525;
}

.notification-item.unread {
    background: rgba(74, 144, 226, 0.05);
}

.notification-item.unread:hover {
    background: rgba(74, 144, 226, 0.1);
}

.notification-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #333;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-message {
    color: white;
    font-size: 0.9rem;
    margin-bottom: 4px;
    line-height: 1.4;
}

.notification-time {
    color: #888;
    font-size: 0.8rem;
}

.notification-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.notification-action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.notification-action-btn.accept {
    background: #4a90e2;
    color: white;
}

.notification-action-btn.accept:hover {
    background: #357abd;
}

.notification-action-btn.decline {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.notification-action-btn.decline:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.notifications-empty {
    padding: 40px 20px;
    text-align: center;
    color: #888;
}

.notifications-empty i {
    font-size: 2rem;
    margin-bottom: 12px;
    display: block;
    opacity: 0.5;
}

/* User Profile Image Wrapper */
#user-wrapper {
    position: relative;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#user-profile-image-wrapper {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

#user-profile-image {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: #333;
    background-size: cover;
    background-position: center;
    border: 2px solid #991b1e;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

#user-profile-image-wrapper:hover #user-profile-image {
    border-color: #b02226;
    transform: scale(1.05);
}

#user-drop-arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid white;
    transition: transform 0.3s ease;
}

#user-profile-image-wrapper:hover #user-drop-arrow {
    transform: rotate(180deg);
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    min-width: 250px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-dropdown-header {
    padding: 16px;
    border-bottom: 1px solid #333;
}

.user-dropdown-name {
    font-weight: 600;
    color: white;
    font-size: 1rem;
    margin-bottom: 4px;
}

.user-dropdown-username {
    color: #999;
    font-size: 0.9rem;
}

.user-dropdown-divider {
    height: 1px;
    background: #333;
    margin: 8px 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: white;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.user-dropdown-item:hover {
    background-color: #252525;
}

.user-dropdown-item span {
    font-size: 1.2rem;
}

/* Auth Modal */
.auth-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 5000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.auth-modal-overlay.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-modal-content {
    background: #1a1a1a;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.auth-modal-header h2 {
    color: white;
    margin: 0;
    font-size: 1.5rem;
}

.auth-modal-close {
    color: #999;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.auth-modal-close:hover {
    color: white;
}

.auth-modal-tabs {
    display: flex;
    border-bottom: 1px solid #333;
}

.auth-tab {
    flex: 1;
    padding: 16px;
    background: transparent;
    border: none;
    color: #999;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.auth-tab.active {
    color: white;
    border-bottom-color: #991b1e;
}

.auth-tab:hover {
    color: white;
    background-color: rgba(153, 27, 30, 0.1);
}

.auth-modal-body {
    padding: 24px;
}

/* Auth Forms */
.auth-form {
    display: block;
}

.auth-form-group {
    margin-bottom: 20px;
}

.auth-form-group label {
    display: block;
    color: white;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.95rem;
}

.auth-input {
    width: 100%;
    padding: 12px 16px;
    background: #252525;
    border: 2px solid #333;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.auth-input:focus {
    outline: none;
    border-color: #991b1e;
    background: #2a2a2a;
}

.auth-input.error {
    border-color: #dc3545;
}

.auth-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ccc;
    font-size: 0.9rem;
    cursor: pointer;
}

.auth-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.auth-checkbox-label a {
    color: #991b1e;
    text-decoration: none;
}

.auth-checkbox-label a:hover {
    text-decoration: underline;
}

.auth-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #991b1e 0%, #7a1518 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(153, 27, 30, 0.5);
    background: linear-gradient(135deg, #b02226 0%, #991b1e 100%);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Messages */
.auth-error-message {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

.auth-success-message {
    color: #28a745;
    font-size: 0.85rem;
    margin-top: 5px;
    display: block;
}

.auth-check-message {
    font-size: 0.85rem;
    margin-top: 5px;
    display: block;
}

.auth-error-container {
    margin-top: 16px;
}

.auth-error-container .auth-error-message {
    padding: 12px;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid #dc3545;
    border-radius: 8px;
    display: block;
}

/* Responsive */
@media (max-width: 970px) {
    /* Sakrij login button na mobilnim uređajima jer postoji hamburger menu */
    #user-wrapper {
        display: none !important;
    }
    
    .auth-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .user-dropdown {
        right: -10px;
    }
}

@media (max-width: 768px) {
    .auth-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .user-dropdown {
        right: -10px;
        min-width: 220px;
    }
}

/* Close dropdown when clicking outside */
body.user-dropdown-open {
    position: relative;
}

