/* General body styles */
body {
    font-family: 'Inter', sans-serif;
    background-color: #111827;
    /* Tailwind gray-900 */
}

/* --- NEW: Header Logo --- */
.header-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    /* Prevents the image from being distorted */
    border: 2px solid #4B5563;
    /* Adds a border that matches the theme */
}


/* Style for guild cards */
.guild-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    background-color: #1F2937;
    /* Tailwind gray-800 */
}

.guild-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

/* Styles for settings sections */
.settings-section {
    border-left: 4px solid #374151;
    /* gray-700 */
    background-color: #1F2937;
}

/* Styles for form inputs */
input[type="text"],
input[type="number"],
textarea,
select {
    background-color: #374151;
    /* gray-700 */
    border: 1px solid #4B5563;
    /* gray-600 */
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    color: white;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #3B82F6;
    /* blue-500 */
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4);
}

/* Brighter placeholder text */
::placeholder {
    color: #9CA3AF;
    /* gray-400 - brighter than default */
    opacity: 1;
}

::-webkit-input-placeholder {
    color: #9CA3AF;
}

::-moz-placeholder {
    color: #9CA3AF;
}

:-ms-input-placeholder {
    color: #9CA3AF;
}

/* Specific padding for smaller inputs in tables */
td input[type="number"],
td select {
    padding: 0.5rem;
}


textarea {
    min-height: 120px;
    font-family: monospace;
    font-size: 0.875rem;
}

/* Multi-selector component styles */
.multi-selector-container {
    position: relative;
    /* Ensures correct positioning for autocomplete list */
    border-radius: 0.375rem;
    background-color: #374151;
    border: 1px solid #4B5563;
}

.multi-selector-container .pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #3B82F6;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.multi-selector-container .pill .remove-btn {
    cursor: pointer;
    font-weight: bold;
}

.multi-selector-container .selector-input {
    background: transparent;
    border: none;
    outline: none;
    color: white;
    /* Remove redundant padding/border from the input itself */
    padding: 0;
    border-radius: 0;
}

.multi-selector-container .selector-input:focus {
    box-shadow: none;
    /* Disable focus shadow on inner input */
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    /* Position below the container */
    left: 0;
    right: 0;
    background-color: #2b3648;
    /* Darker background for contrast */
    border: 1px solid #4B5563;
    /* gray-600 */
    z-index: 1000;
    border-radius: 0.375rem;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 0.25rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.autocomplete-list div.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: #E5E7EB;
    /* gray-200 */
    transition: background-color 0.15s;
}

.autocomplete-list div.autocomplete-item:hover {
    background-color: #3B82F6;
    /* blue-500 */
    color: white;
}

/* Family chart layout fixes */
.f3 {
    position: relative;
}

.f3 .main_svg,
.f3 .svg_cont,
.f3 .card_cont {
    overflow: visible;
}

.f3 .card_cont {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: auto;
}

.f3 .card {
    width: 250px;
    height: 102px;
    box-sizing: border-box;
}


/* Loading Spinner */
.loader {
    border: 4px solid #4B5563;
    border-top: 4px solid #3B82F6;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-container {
    background-color: #1F2937;
    padding: 2rem;
    border-radius: 0.5rem;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

/* --- Character Card styles --- */
.character-card {
    background-color: #374151;
    border-radius: 0.5rem;
    padding: 1rem;
}

.character-image-grid img,
#image-previews img {
    transition: transform 0.2s ease;
}

.character-image-grid img:hover,
#image-previews img:hover {
    transform: scale(1.05);
    z-index: 10;
    position: relative;
}

/* --- NEW: Info Tooltip Styles --- */
.info-tooltip-container {
    position: relative;
    display: inline-flex;
    /* Use inline-flex to align icon nicely */
    align-items: center;
}

.info-icon {
    cursor: help;
    /* Change cursor to indicate it's helpful */
}

/* The tooltip text box */
.tooltip-text {
    visibility: hidden;
    opacity: 0;
    width: 240px;
    background-color: #111827;
    /* gray-900 */
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 8px 12px;
    border: 1px solid #4B5563;
    /* gray-600 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    font-size: 0.875rem;
    font-weight: normal;
    text-transform: none;
    /* Override capitalize from label */

    /* Position the tooltip */
    position: absolute;
    z-index: 1;
    bottom: 150%;
    /* Position above the icon */
    left: 50%;
    transform: translateX(-50%);
    /* Center the tooltip */

    transition: opacity 0.2s ease-in-out;
}

/* Tooltip arrow */
.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    /* At the bottom of the tooltip */
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #111827 transparent transparent transparent;
}


/* Show the tooltip text when you mouse over the tooltip container */
.info-tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.tooltip-text strong {
    color: #60A5FA;
    /* blue-400 */
    font-weight: 600;
}


.peer:checked+div::after {
    transform: translateX(100%);
    border-color: white;
}

div[class*="after:content-['']"]::after {
    content: '';
}

/* Fallback for .hidden class */
.hidden {
    display: none;
}


/* --- START NEW CYBER PREMIUM THEME EXTENSIONS --- */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

/* Apply Outfit font only if specifically requested or to new elements, 
   but body already has Inter. Let's keep Inter for legacy compatibility 
   but allow Outfit for new components */
.font-outfit {
    font-family: 'Outfit', sans-serif;
}

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

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
    /* Transparent track for cleaner look */
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #4b5563;
    /* gray-600 */
    border-radius: 9999px;
    /* Fully rounded */
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #60a5fa;
    /* blue-400 */
}

/* Glassmorphism Utilities */
.glass {
    background: rgba(31, 41, 55, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Loader */
.loader-spin {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-left-color: #60a5fa;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

/* Tooltip */
.tooltip-trigger:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Input Range Customization */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #374151;
    border-radius: 2px;
}

/* --- Phase 5 UX Polish --- */

/* Focus-visible for keyboard navigation */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Button press feedback */
button:active:not(:disabled) {
    transform: scale(0.97);
}

/* Smooth image loading */
img {
    background-color: #374151;
}

/* Better disabled state */
button:disabled,
input:disabled,
select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Tab focus ring for cards */
.group:focus-within {
    box-shadow: 0 0 0 2px #3b82f6;
}

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

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Shake animation for error states */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }
}

.animate-shake {
    animation: shake 0.3s ease-in-out;
}

/* Smooth enter animation for modals */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.animate-slide-up {
    animation: slideUp 0.3s ease-out forwards;
}

/* Hide scrollbar for cleaner modals (still scrollable) */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* --- Animations & Loaders --- */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader-spin {
    animation: spin 1s linear infinite;
    border-radius: 50%;
    border-color: rgba(139, 92, 246, 0.3);
    /* purple-500/30 */
    border-top-color: #8b5cf6;
    /* purple-500 */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}
