/* Common CSS styles for MLM Income application */

/* Toaster Message Styling - Force right positioning */
#messageContainer {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    left: auto !important;
    z-index: 9999 !important;
    max-width: 400px;
    pointer-events: none;
    transform: none !important;
}

/* Override any conflicting Bootstrap classes */
#messageContainer.position-fixed {
    position: fixed !important;
}

#messageContainer.top-0 {
    top: 20px !important;
}

#messageContainer.end-0 {
    right: 20px !important;
    left: auto !important;
}

#messageContainer.p-3 {
    padding: 0 !important;
}

#messageContainer .alert {
    margin-bottom: 0.75rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border: none;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border-left: 4px solid;
    font-weight: 500;
    padding: 1rem 1.25rem;
    min-width: 350px;
    animation: slideInRight 0.4s ease-out;
    pointer-events: auto;
    position: relative !important;
    overflow: visible !important;
    padding-right: 5rem !important; /* Make more space for bigger close button */
}

#messageContainer .alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

#messageContainer .alert-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-left-color: #198754;
}

#messageContainer .alert-danger {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    color: white;
    border-left-color: #c82333;
}

#messageContainer .alert-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ffca2c 100%);
    color: #000;
    border-left-color: #e0a800;
}

#messageContainer .alert-info {
    background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
    color: white;
    border-left-color: #138496;
}

#messageContainer .alert-primary {
    background: linear-gradient(135deg, #007bff 0%, #6610f2 100%);
    color: white;
    border-left-color: #0056b3;
}

/* Animation for toaster messages */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Loading spinner styling */
.alert-info .spinner-border {
    width: 1rem;
    height: 1rem;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    #messageContainer {
        right: 10px !important;
        left: 10px !important;
        max-width: calc(100vw - 20px);
    }

    #messageContainer .alert {
        min-width: auto;
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
    }
}

/* Dark theme support */
[data-bs-theme="dark"] #messageContainer .alert {
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

/* Hover effects */
#messageContainer .alert:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
    box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}

/* Close button styling - Single close button */
#messageContainer .btn-close {
    color: white;
    top: 18px !important;
    right: 2px;
    right: 3px !important;
    z-index: 10 !important;
    padding: 0rem 0rem !important;

    margin: 0 !important;
    background-repeat: no-repeat !important;
    opacity: 1 !important;
    display: block !important;
    visibility: visible !important;
}

#messageContainer .btn-close:hover {
    opacity: 1 !important;
    background-color: rgba(255,255,255,0.5) !important;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
}

/* Icon styling */
#messageContainer .alert i {
    font-size: 1.1rem;
    margin-right: 0.75rem;
    opacity: 0.9;
}

/* Text styling */
#messageContainer .alert {
    font-size: 0.95rem;
    line-height: 1.4;
    letter-spacing: 0.01em;
}

/* Ensure proper stacking */
#messageContainer .alert:nth-child(1) { z-index: 9999; }
#messageContainer .alert:nth-child(2) { z-index: 9998; }
#messageContainer .alert:nth-child(3) { z-index: 9997; }
#messageContainer .alert:nth-child(4) { z-index: 9996; }
#messageContainer .alert:nth-child(5) { z-index: 9995; }

/* Ensure close button is always visible */
#messageContainer .btn-close {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Force close button to be on the right */
#messageContainer .alert .btn-close {
    right: 14px !important;
    left: auto !important;
}

/* Make close button more prominent */
#messageContainer .btn-close::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.1);
    border-radius: 0 12px 0 0;
    z-index: -1;
}

/* Ensure proper stacking and visibility */
#messageContainer .alert {
    z-index: 9999 !important;
}

#messageContainer .btn-close {
    z-index: 10000 !important;
}

/* RMDT brand row: icon + wordmark vertically centered */
.rmdt-brand {
    display: inline-flex !important;
    align-items: center !important;
}

.rmdt-brand__icon {
    display: block;
    object-fit: contain;
    flex-shrink: 0;
    align-self: center;
    vertical-align: middle;
}

/*
 * RMDT wordmark — light UI: honey / antique gold only (no black–brown gradient).
 * Darkest stops stay in the gold family so it matches the coin on white bars.
 */
.rmdt-brand__text {
    line-height: 1;
    align-self: center;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
    -webkit-font-smoothing: antialiased;
    background: linear-gradient(
        108deg,
        #7a5e12 0%,
        #8b6914 16%,
        #a67c1a 30%,
        #c9a227 44%,
        #d4af37 52%,
        #b8860b 66%,
        #9a7612 84%,
        #856514 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #8b6914;
    filter: drop-shadow(0 1px 2px rgba(122, 94, 18, 0.12));
}

@supports not (-webkit-background-clip: text) {
    .rmdt-brand__text {
        -webkit-text-fill-color: unset;
        background: none;
        color: #8b6914;
        filter: none;
    }
}

[data-bs-theme="light"] .rmdt-brand__icon {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Explicit light theme: same gold metal (avoids any black-tinted fallback from other CSS) */
[data-bs-theme="light"] .rmdt-brand__text {
    background: linear-gradient(
        108deg,
        #6b5210 0%,
        #8b6914 14%,
        #a67c1a 28%,
        #c9a227 42%,
        #e1c04a 50%,
        #d4af37 58%,
        #b8860b 72%,
        #8b6914 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #8b6914;
    filter: drop-shadow(0 1px 2px rgba(107, 82, 16, 0.14));
}

@supports not (-webkit-background-clip: text) {
    [data-bs-theme="light"] .rmdt-brand__text {
        -webkit-text-fill-color: unset;
        background: none;
        color: #8b6914;
        filter: none;
    }
}

/* Brighter gold on dark UI (client dark theme) */
[data-bs-theme="dark"] .rmdt-brand__text {
    background: linear-gradient(
        122deg,
        #fffef5 0%,
        #ffe566 22%,
        #ffd700 42%,
        #fff8dc 55%,
        #daa520 78%,
        #b8860b 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #daa520;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.65));
}

@supports not (-webkit-background-clip: text) {
    [data-bs-theme="dark"] .rmdt-brand__text {
        -webkit-text-fill-color: unset;
        background: none;
        color: #f0d060;
        filter: none;
    }
}
