/* Base Styles */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #FFFFFF;
    background-color: #111827;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

.section {
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
}

/* 3D Background Elements */
.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(5, 150, 105, 0.05) 100%);
    z-index: 0;
}

.circuit-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(to right, rgba(16, 185, 129, 0.1) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(16, 185, 129, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: perspective(1000px) rotateX(60deg);
    transform-origin: top;
    opacity: 0.2;
    z-index: 0;
}

/* 3D Cards */
.card-3d {
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 1rem;
    padding: 2rem;
    backdrop-filter: blur(10px);
    transform-style: preserve-3d;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.card-3d:hover {
    transform: translateY(-10px) rotateX(5deg) rotateY(5deg);
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-style: preserve-3d;
    perspective: 1000px;
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px) rotateX(10deg);
    box-shadow: 0 6px 30px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10B981;
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(16, 185, 129, 0.1);
    transform: translateY(-3px) rotateX(10deg);
    box-shadow: 0 6px 30px rgba(16, 185, 129, 0.2);
}

/* Text Styles */
.text-gradient {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Glow Effects */
.glow {
    position: relative;
}

.glow::after {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    filter: blur(15px);
    opacity: 0.3;
    z-index: -1;
    transition: all 0.4s ease;
}

.glow:hover::after {
    opacity: 0.5;
    filter: blur(20px);
}

/* Section Headers */
.section-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    color: white;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #10B981, #047857);
    border-radius: 2px;
}

/* Grid Layouts */
.grid-3d {
    display: grid;
    gap: 2rem;
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .section {
        padding: 4rem 0;
    }

    .section-title {
        font-size: 2.5rem;
    }

    .card-3d {
        transform: none !important;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #1F2937;
}

::-webkit-scrollbar-thumb {
    background: #10B981;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #059669;
}

/* Forms */
.input-3d {
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: white;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.input-3d:focus {
    border-color: #10B981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
    outline: none;
}

/* Tables */
.table-3d {
    width: 100%;
    background: rgba(31, 41, 55, 0.8);
    border-radius: 1rem;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.table-3d th {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
}

.table-3d td {
    padding: 1rem;
    border-bottom: 1px solid rgba(16, 185, 129, 0.1);
    color: white;
}

/* Loading Animations */
.loading-3d {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(16, 185, 129, 0.3);
    border-top-color: #10B981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Tooltips */
.tooltip-3d {
    position: relative;
    display: inline-block;
}

.tooltip-3d::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: rgba(31, 41, 55, 0.9);
    color: white;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.tooltip-3d:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* Fix for input text color in dark backgrounds */
input, select, textarea {
    color: #FFFFFF;
}

input::placeholder, 
select::placeholder, 
textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Fix for light backgrounds */
.bg-white input, 
.bg-white select, 
.bg-white textarea,
.bg-gray-50 input, 
.bg-gray-50 select, 
.bg-gray-50 textarea {
    color: #374151;
}

.bg-white input::placeholder, 
.bg-white select::placeholder, 
.bg-white textarea::placeholder,
.bg-gray-50 input::placeholder, 
.bg-gray-50 select::placeholder, 
.bg-gray-50 textarea::placeholder {
    color: rgba(55, 65, 81, 0.6);
}

/* Fix for form elements in light sections */
.bg-white/90 input, 
.bg-white/90 select, 
.bg-white/90 textarea,
.bg-gray-50/50 input, 
.bg-gray-50/50 select, 
.bg-gray-50/50 textarea {
    color: #374151;
}

/* Admin panel specific fixes */
.admin-panel input,
.admin-panel select,
.admin-panel textarea {
    color: #374151;
    background-color: #FFFFFF;
}

/* Fix for mobile navigation */
.mobile-nav-active {
    overflow: hidden;
}

/* Fix for back button behavior */
.back-button {
    cursor: pointer;
    user-select: none;
}

/* Fix for form inputs to ensure text is always visible */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
textarea,
select {
    -webkit-text-fill-color: currentColor;
    opacity: 1;
}

/* Dark theme forms - ensure text is visible */
.bg-gray-800 input,
.bg-gray-800 textarea,
.bg-gray-800 select,
.bg-gray-900 input,
.bg-gray-900 textarea,
.bg-gray-900 select {
    color: white !important;
    background-color: #1F2937 !important;
}

/* Light theme forms - ensure text is visible */
.bg-white input,
.bg-white textarea,
.bg-white select,
.bg-gray-50 input,
.bg-gray-50 textarea,
.bg-gray-50 select {
    color: #374151 !important;
    background-color: white !important;
}

/* Auth forms - ensure text is visible */
.auth-form input,
.auth-form textarea,
.auth-form select {
    color: #374151 !important;
    background-color: white !important;
}

/* Donation forms - ensure text is visible in dark backgrounds */
.donation-form input,
.donation-form textarea,
.donation-form select {
    color: white !important;
    background-color: #1F2937 !important;
}

/* Ensure disabled inputs have visible text */
input:disabled,
textarea:disabled,
select:disabled {
    opacity: 0.75;
}
