/* Import Open Sans font */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&display=swap');

/* === Global Styles === */
:root {
    /* Primary color definition - matches the icon color */
    --primary-color: #4663b4ea; /* Tailwind's blue-500 */
    --primary-color-hover: #4663b4ea; /* Tailwind's blue-600 */
    --primary-color-focus: rgba(59, 130, 246, 0.5); /* Matching focus shadow */
    --primary-color-border: #93C5FD; /* Light blue border - Tailwind's blue-200 */
    --primary-color-glow: rgba(147, 197, 253, 0.8); /* Soft blue glow effect */

    /* Negative button colors */
    --negative-color: #96bad052; /* Semi-transparent purple */
    --negative-color-hover: #5a317c57; /* Darker semi-transparent purple */
    --negative-color-focus: rgba(239, 68, 68, 0.5); /* Red focus shadow */
}

/* Apply Open Sans to all text except Material Icons and about page */
*:not(.material-icons):not([class*="material-"]):not(.about-page):not(.about-page *) {
    font-family: 'Open Sans', sans-serif !important;
}

body {
    background-color: #1a202c;
    /* Tailwind's gray-900 */
    color: #e2e8f0;
    /* Tailwind's gray-300 */
    font-family: 'Open Sans', sans-serif !important;
}

/* === Typography === */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: #edf2f7;
    /* Tailwind's gray-100 */
}

/* === Landing Page Animations === */

/* Glowing text effect for hero title */
.text-glow {
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.5),
                 0 0 40px rgba(59, 130, 246, 0.3),
                 0 0 60px rgba(59, 130, 246, 0.2);
}

/* Floating animation for hero elements */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.float-animation {
    animation: float 6s ease-in-out infinite;
}

/* Pulse glow animation for accent elements */
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(59, 130, 246, 0.5); }
    50% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.8), 0 0 30px rgba(59, 130, 246, 0.6); }
}

.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

/* Enhanced hover effects for cards */
.card-hover {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-hover:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(59, 130, 246, 0.1);
}

/* Gradient border animation */
@keyframes gradientBorder {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.gradient-border {
    background: linear-gradient(-45deg, #3b82f6, #8b5cf6, #3b82f6, #6366f1);
    background-size: 400% 400%;
    animation: gradientBorder 4s ease infinite;
    padding: 2px;
    border-radius: 0.5rem;
}

.gradient-border-inner {
    background: #1f2937; /* gray-800 */
    border-radius: 0.375rem;
    height: 100%;
    width: 100%;
}

/* Scroll reveal animation */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-up {
    animation: slideInUp 0.8s ease-out forwards;
}

/* Matrix-style background dots */
.matrix-bg {
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(59, 130, 246, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(139, 92, 246, 0.1) 2px, transparent 2px);
    background-size: 60px 60px;
    background-position: 0 0, 30px 30px;
}

/* Enhanced button styles */
.btn-primary-enhanced {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border: none;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-primary-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary-enhanced:hover::before {
    left: 100%;
}

.btn-primary-enhanced:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
}

/* Gaming-style section dividers */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #3b82f6, #8b5cf6, #3b82f6, transparent);
    margin: 2rem 0;
}

/* Icon container animations */
.icon-container {
    transition: all 0.3s ease;
    position: relative;
}

.icon-container::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: -1;
}

.icon-container:hover::after {
    width: 80px;
    height: 80px;
}

/* === Original Component Styles === */

/* Primary Button */
.button-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease-in-out;
}

.button-primary:hover {
    background-color: var(--primary-color-hover);
}

.button-primary:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-color-focus);
}

/* Negative Button */
.button-negative {
    background-color: var(--negative-color);
    color: #ffffff;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease-in-out;
}

.button-negative:hover {
    background-color: var(--negative-color-hover);
}

.button-negative:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--negative-color-focus);
}

/* Locked/disabled fields - new styling */
.locked-field {
    background-color: rgba(55, 65, 81, 0.3) !important; /* gray-700 with low opacity */
    border: 1px solid rgba(107, 114, 128, 0.5) !important; /* gray-500 with transparency */
    color: rgba(156, 163, 175, 0.8) !important; /* gray-400 with transparency */
    cursor: not-allowed !important;
}

.locked-field:focus {
    outline: none !important;
    box-shadow: none !important;
    border-color: rgba(107, 114, 128, 0.5) !important; /* Keep same gray border on focus */
}

/* Locked field icon styling */
.locked-icon {
    color: rgba(156, 163, 175, 0.6) !important; /* gray-400 with transparency */
    pointer-events: none;
}

/* Hover effects for locked fields */
.locked-field:hover {
    background-color: rgba(55, 65, 81, 0.4) !important; /* Slightly more visible on hover */
}

/* Success state styling */
.field-success {
    border-color: rgba(16, 185, 129, 0.8) !important; /* green-500 */
    background-color: rgba(16, 185, 129, 0.1) !important; /* green tint */
}

.field-success:focus {
    outline: 2px solid rgba(16, 185, 129, 0.3) !important;
    border-color: rgba(16, 185, 129, 1) !important;
}

/* Error state styling */
.field-error {
    border-color: rgba(239, 68, 68, 0.8) !important; /* red-500 */
    background-color: rgba(239, 68, 68, 0.1) !important; /* red tint */
}

.field-error:focus {
    outline: 2px solid rgba(239, 68, 68, 0.3) !important;
    border-color: rgba(239, 68, 68, 1) !important;
}

/* Loading state styling */
.field-loading {
    position: relative;
}

.field-loading::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-top: 2px solid rgba(59, 130, 246, 1);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* === Responsive adjustments === */
@media (max-width: 768px) {
    .card-hover:hover {
        transform: translateY(-2px) scale(1.01);
    }
    
    .float-animation {
        animation-duration: 4s;
    }
}

/* === Print styles === */
@media print {
    .btn-primary-enhanced,
    .button-primary,
    .button-negative {
        background: #333 !important;
        color: white !important;
        box-shadow: none !important;
    }
}

/* === Button Components === */

/* Transparent Blue Button - Based on profile save changes button */
.button-transparent-blue {
    background: transparent !important;
    border: 1px solid rgba(59, 130, 246, 0.25) !important;
    color: #93C5FD !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    padding: 0.5rem 1.25rem !important;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    display: inline-block;
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

.button-transparent-blue:hover {
    background: rgba(59, 130, 246, 0.08) !important;
    border-color: rgba(59, 130, 246, 0.4) !important;
    color: #BFDBFE !important;
}

.button-transparent-blue:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
}

.button-transparent-blue:active {
    background: rgba(59, 130, 246, 0.12) !important;
}

/* Transparent White Button - Based on profile logout button */
.button-transparent-white {
    background: transparent !important;
    border: none !important;
    color: #FFFFFF !important;
    font-weight: 500 !important;
    font-size: 0.9rem !important;
    letter-spacing: 0.02em;
    transition: all 0.2s ease !important;
    padding: 0.5rem 1.25rem !important;
    display: inline-block;
    text-align: center !important;
    text-decoration: none !important;
    border-radius: 0.25rem !important;
    cursor: pointer;
}

.button-transparent-white:hover {
    color: #93C5FD !important;
}

.button-transparent-white:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3) !important;
}

.button-transparent-white:active {
    color: #E5E7EB !important;
}

/* === Components === */

/* Style placeholder text for locked fields */
.locked-field option {
    text-align: center;
    color: #4a5568 !important; 
}

/* For empty select fields, remove the dashes */
select.locked-field option[value=""] {
    content: "Unavailable";
}

/* Unlocked fields: add proper background and text */
.unlocked-field {
    background-color: #2d3748;
    /* Matches other unlocked fields */
    color: #edf2f7;
    /* Light text */
    border-color: #4a5568;
    cursor: text;
    opacity: 1;
}

/* Form Label */
.label {
    color: #e2e8f0;
    /* Tailwind's gray-300 */
    font-weight: bold;
    margin-bottom: 0.5rem;
}

/* === Layout Components === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.card {
    background-color: #2d3748;
    /* Tailwind's gray-800 */
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-header {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.card-content {
    font-size: 1rem;
    line-height: 1.5;
}

/* === Navbar === */
.navbar {
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: #333;
    color: #ffffff;
}

.navbar a {
    color: #ffffff;
    text-decoration: none;
    margin: 0 10px;
}

.navbar a:hover {
    text-decoration: underline;
}

/* === Tabs === */
.tabs-container {
    display: flex; 
    /* border-bottom: 3px solid #4a5568; */
    /* Tailwind's gray-600 */
    width: fit-content;
}

.tab {
    padding: 0.5rem 0.75rem;
    background-color: #1f2937;
    /* Tailwind gray-800 */
    color: #9ca3af;
    /* Tailwind gray-400 */
    border-top: 3px solid transparent;
    transition: all 0.1s ease-in-out;
}

.tab:hover {
    background-color: #374151;
    /* Tailwind gray-700 */
    color: #e2e8f0;
}

.tab.active {
    background-color: var(--primary-color);
    color: #ffffff;
    border-top: 3px solid var(--primary-color);
}

/* === Utility Classes === */
.mt-1 {
    margin-top: 0.25rem;
}

.mt-4 {
    margin-top: 1rem;
}

.w-full {
    width: 100%;
}

.hidden {
    display: none;
}

.text-center {
    text-align: center;
}

.text-red {
    color: #e53e3e;
    /* Tailwind red-600 */
}

.text-gray {
    color: #e2e8f0;
    /* Tailwind gray-300 */
}

.bg-dark {
    background-color: #1a202c;
    /* Tailwind gray-900 */
}

.rounded {
    border-radius: 4px;
}

/* Button base styles */
.button-primary,
.button-negative {
    display: flex;
    /* Ensure flexbox for centering */
    align-items: center;
    /* Center content vertically */
    justify-content: center;
    /* Center content horizontally */
    height: 2.5rem;
    /* Consistent height */
    padding: 0 1rem;
    /* Horizontal padding */
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease-in-out;
}

.button-negative:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--negative-color-focus);
}

/* Header Style for 'Your Worlds' */
#world-list-header {
    background-color: #1f2937;
    /* Dark gray (Tailwind gray-800) */
    color: #e2e8f0;
    /* Light gray text (Tailwind gray-300) */
}

#world-list li.bg-blue-500.text-white {
    font-weight: bold;
    color: #ffffff;
    border: 2px solid var(--primary-color-border);
    box-shadow: 0 0 8px var(--primary-color-glow);
}

#element-list li.bg-blue-500.text-white {
    font-weight: bold;
    color: #ffffff;
    border: 2px solid var(--primary-color-border);
    box-shadow: 0 0 8px var(--primary-color-glow);
}

/* Add styling for active-element class */
#element-list li.active-element {
    font-weight: bold;
    color: #ffffff;
    border: 2px solid var(--primary-color-border);
    box-shadow: 0 0 8px var(--primary-color-glow);
}

/* Add styling for active-world class */
#world-list li.active-world {
    font-weight: bold;
    color: #ffffff;
    border: 2px solid var(--primary-color-border);
    box-shadow: 0 0 8px var(--primary-color-glow);
}

#edit-element-form input,
#edit-element-form select,
#edit-element-form textarea {
    background-color: #2d3748;
    /* Dark background */
    color: #edf2f7;
    /* Light text */
    border-color: #4a5568;
    cursor: text;
    opacity: 1;
    width: 100%;
    border-radius: 4px;
    padding: 0.5rem;
}