/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400..900&family=Roboto:wght@400;500;700&display=swap');

body {
    /* Smooth scrolling for anchor links if needed */
    scroll-behavior: smooth;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #374151;
    /* gray-700 */
    border-radius: 10px;
}

html.light ::-webkit-scrollbar-track {
    background: #e5e7eb;
    /* gray-200 */
}


::-webkit-scrollbar-thumb {
    background-color: #6b7280;
    /* gray-500 */
    border-radius: 10px;
    border: 2px solid #374151;
    /* gray-700 - Make border same as track for inset look */
}

html.light ::-webkit-scrollbar-thumb {
    background-color: #9ca3af;
    /* gray-400 */
    border: 2px solid #e5e7eb;
    /* gray-200 */
}

::-webkit-scrollbar-thumb:hover {
    background-color: #9ca3af;
    /* gray-400 */
}

html.light ::-webkit-scrollbar-thumb:hover {
    background-color: #6b7280;
    /* gray-500 */
}

/* Ensure sidebar scroll container respects flex height */
#sidebar>div:nth-child(2) {
    /* Targeting the scrollable content area */
    min-height: 0;
    /* Allows the container to shrink and enable scrolling */
}


/* Style for active tabs */
.tab-button.active {
    /* Tailwind classes define most styles */
}

/* Style for active tab content */
.tab-content.active {
    display: block;
    /* Or flex, grid depending on layout */
}

/* Slight animation for progress bars */
#ap-bar,
#hp-bar {
    transition: width 0.5s ease-in-out;
}

/* Line clamp utility */
.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* Adjust tab scrolling on smaller viewports if necessary */
@media (max-width: 640px) {
    #shouts-section nav {
        /* Example for shouts tabs */
        justify-content: flex-start;
    }
}

.minipic {
    border-radius: 27%;
    width: 4em;
    height: 4em;
}

.tinypic {
    display: inline;
    border-radius: 27%;
    width: 2em;
    height: 2em;
}

.avatarpic {
    border-radius: 27%;
    width: 8em;
    height: 8em;
}

.booster-button {
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.booster-button.active {
    background-color: #2563eb;
    color: white;
    border-color: #2563eb;
    transform: scale(1.05);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

html.dark .booster-button.active {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

/* Filter Button Styling */
.filter-button {
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.filter-button.active {
    @apply bg-primary text-white border-primary shadow-md ring-2 ring-primary/50 dark:bg-primary-light dark:border-primary-light dark:ring-primary-light/50;
}

.filter-button:not(.active):hover {
    @apply bg-gray-100 border-gray-400 dark:bg-gray-700 dark:border-gray-500;
}

/* Custom Select Dropdown */
.custom-select-container {
    position: relative;
}

.custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
}

/* Army page */

.edit-toggle-label {
    cursor: pointer;
}

.edit-toggle-checkbox:checked+.edit-toggle-bg {
    background-color: #2563eb;
}

html.dark .edit-toggle-checkbox:checked+.edit-toggle-bg {
    background-color: #3b82f6;
}

.edit-toggle-checkbox:checked+.edit-toggle-bg .edit-toggle-dot {
    transform: translateX(100%);
}

.edit-toggle-dot {
    transition: transform 0.2s ease-in-out;
}

.data-label::before {
    content: attr(data-label);
    @apply font-medium text-gray-500 dark:text-gray-400 mr-1;
}

@media (min-width: 1024px) {
    .data-label::before {
        content: '';
        @apply mr-0;
    }
}

.tab-button.active {
    @apply border-primary text-primary dark:border-primary-light dark:text-primary-light;
}

.tab-content.hidden {
    display: none;
}

.modal-scrollable-content::-webkit-scrollbar {
    width: 6px;
}

.modal-scrollable-content::-webkit-scrollbar-track {
    background: transparent;
}

html.dark .modal-scrollable-content::-webkit-scrollbar-thumb {
    background-color: #4b5563;
    border-radius: 3px;
}

html.light .modal-scrollable-content::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 3px;
}

.inventory-item-select {
    transition: all 0.2s ease-in-out;
}

.inventory-item-select.selected {
    @apply ring-2 ring-primary dark:ring-primary-light scale-105 shadow-lg;
}


.edit-toggle-label {
    cursor: pointer;
}

.edit-toggle-checkbox {
    display: none;
}

.edit-toggle-checkbox:checked+.edit-toggle-bg {
    background-color: #2563eb;
}

html.dark .edit-toggle-checkbox:checked+.edit-toggle-bg {
    background-color: #3b82f6;
}

.edit-toggle-checkbox:checked+.edit-toggle-bg .edit-toggle-dot {
    transform: translateX(100%);
}

.edit-toggle-dot {
    transition: transform 0.2s ease-in-out;
}

.word-break {
    overflow-x: hidden;
    word-break: break-word;
    hyphens: auto;
}

/* Sidebar Dropdown */
.dropdown-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

.dropdown-menu:not(.hidden) {
    max-height: 500px;
    /* Adjust as needed */
}

.dropdown-toggle .fa-chevron-down {
    transition: transform 0.3s ease-in-out;
}

.shout-content {
    overflow-x: hidden;
    word-break: break-word;
}

.tooltip-v2 .tooltiptext-v2 {
    visibility: hidden;
    width: max-content;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 8px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    transform: translateX(-10%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.75rem;
    max-width: 20em;
    max-height: 20em;
}

.tooltip-v2:hover .tooltiptext-v2 {
    visibility: visible;
    opacity: 1;
}

.tooltip-parent:hover .tooltiptext-v2 {
    visibility: visible;
    opacity: 1;
}

.tutorial-btn {
    @apply hidden;
}

.alert-item {
    transition: background-color 0.2s ease-in-out;
}

.alert-item.unread {
    @apply bg-blue-50 dark:bg-blue-900/30 border-l-4 border-primary;
}

/* Activity Badge Pulse Animation */
@keyframes pulse-green {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* ============================================================================
   MODAL RESPONSIVE FIX
   ============================================================================
   Ensures modals are scrollable on small screens and don't overflow viewport
   ========================================================================= */

/* Modal container - make scrollable */
[role="dialog"] {
    overflow-y: auto !important;
}

/* Modal content - ensure proper spacing and max height */
[role="dialog"] .modal-content {
    margin-top: auto;
    margin-bottom: auto;
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
}

/* Ensure modal headers and footers don't shrink */
[role="dialog"] .modal-content>div:first-child,
[role="dialog"] .modal-content>div:last-child {
    flex-shrink: 0;
}

/* Modal body sections should be scrollable if needed */
[role="dialog"] .modal-content>div:not(:first-child):not(:last-child) {
    overflow-y: auto;
    flex-shrink: 1;
    flex-grow: 1;
    min-height: 0;
}

/* Override overflow for nested divs inside modal sections */
[role="dialog"] .modal-content>div>div {
    overflow: visible;
}

/* Fix for icon containers and other elements that shouldn't scroll */
.modal-big-icon {
    overflow: visible !important;
}

/* ============================================================================
   BATTLE PAGE STYLES
   ============================================================================ */

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.7);
}

/* Slide-in Animation */
@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slide-out-right {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

.animate-slide-in-right {
    animation: slide-in-right 0.3s ease-out forwards;
}

.animate-slide-out-right {
    animation: slide-out-right 0.3s ease-in forwards;
}

/* Hit Type Colors */
.text-hit-critical {
    color: #ef4444;
    /* red-500 */
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.text-hit-normal {
    color: #10b981;
    /* green-500 */
}

.text-hit-unlucky {
    color: #f59e0b;
    /* amber-500 */
}

/* Scale on Hover */
.hover\:scale-102:hover {
    transform: scale(1.02);
}

.hover\:scale-105:hover {
    transform: scale(1.05);
}

/* Border Width 3 */
.border-3 {
    border-width: 3px;
}

/* For very small screens (mobile landscape) */
@media (max-height: 600px) {
    [role="dialog"] .modal-content {
        max-height: calc(100vh - 1rem);
    }

    [role="dialog"] {
        padding: 0.5rem !important;
    }
}