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

/* ===== Base Theme Variables (Light Theme) ===== */
:root {
--primary: #6366f1; /* Main brand color */
--primary-dark: #4f46e5; /* Darker primary for hover/active */
--primary-light: #a5b4fc; /* Lighter primary for subtle accents */
--secondary: #818cf8; /* Secondary accent color */
--text-primary: #1e293b; /* Dark text/element color */
--text-secondary: #0f172a; /* Even darker text/headings */
--bg-light: #ffffff; /* White background */
--bg-lighter: #f8fafc; /* Even lighter gray, almost white */
--text-gray: #64748b; /* General text color */
--border-color: #e2e8f0; /* Light border color */
--card-bg: #ffffff; /* Card background */
--card-hover-bg: #f5f9fc; /* Card hover background */
--input-bg: #ffffff; /* Input background */
--input-border: #e2e8f0; /* Input border */
--placeholder-color: #94a3b8; /* Placeholder color */
--modal-overlay: rgba(15, 23, 42, 0.75); /* Dark overlay */
--success: #10b981; /* Success feedback */
--warning: #f59e0b; /* Warning warning */
--danger: #ef4444; /* Danger feedback */
--transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Global transition */
--shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.03); /* Subtle shadow */
--shadow: 0 4px 8px -2px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06); /* Medium shadow */
--shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.08); /* Stronger shadow */
--shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.06); /* Large shadow */
--border-radius: 12px; /* Slightly larger border radius */
--border-radius-sm: 8px; /* Slightly larger small border radius */
--navbar-height: 70px;
}

/* ===== Dark Theme Variables ===== */
body.dark-theme {
--text-primary: #f1f5f9; /* Light text/element color */
--text-secondary: #e2e8f0; /* Even lighter text/headings */
--bg-light: #1e293b; /* Dark background */
--bg-lighter: #0f172a; /* Even darker background */
--text-gray: #cad2da; /* Brighter gray text color for better readability */ 
--border-color: #334155; /* Darker border color */
--card-bg: #1e293b; /* Card background */
--card-hover-bg: #334155; /* Card hover background */
--input-bg: #0f172a; /* Input background */
--input-border: #334155; /* Input border */
--placeholder-color: #64748b; /* Placeholder color */
--modal-overlay: rgba(0, 0, 0, 0.85); /* Darker overlay */
--shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.15); /* Darker shadows */
--shadow: 0 4px 8px -2px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
--shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
--shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
}

/* ===== General Styles ===== */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
background-color: var(--bg-lighter);
color: var(--text-primary);
padding: 1.5rem;
min-height: 100vh;
-webkit-tap-highlight-color: transparent;
line-height: 1.6;
transition: background-color 0.3s ease, color 0.3s ease;
}

.d-none {
display: none !important;
}

/* ===== Loading Screen Styles ===== */
#loading-screen {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: var(--bg-lighter);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
z-index: 9999;
transition: opacity 0.5s ease;
}

.loading-spinner-large {
border: 5px solid rgba(99, 102, 241, 0.1);
border-top: 5px solid var(--primary);
border-radius: 50%;
width: 50px;
height: 50px;
animation: spin 0.8s linear infinite;
margin-bottom: 15px;
}

.loading-text {
color: var(--text-primary);
font-size: 0.95rem; 
margin-top: 10px;
text-align: center;
font-weight: 500;
}

/* ===== API Links Section ===== */
#apiLinks {
display: flex;
flex-direction: column;
gap: 12px;
margin-bottom: 2.5rem;
animation: fadeIn 0.8s ease-out forwards;
animation-delay: 0.2s;
opacity: 0;
}

#apiLinks span {
font-size: 0.95rem;
font-weight: 500;
color: var(--text-gray);
margin-bottom: -5px;
}

#apiLinks a {
display: inline-flex;
align-items: center;
gap: 10px;
background: var(--bg-light);
padding: 12px 18px;
border-radius: var(--border-radius-sm);
font-size: 0.95rem;
font-weight: 500;
color: var(--primary-dark);
text-decoration: none;
transition: var(--transition);
border: 1px solid var(--border-color);
box-shadow: var(--shadow-sm);
max-width: fit-content;
}

#apiLinks a:hover {
background: var(--card-hover-bg);
border-color: var(--primary);
color: var(--primary-dark);
transform: translateY(-2px);
box-shadow: var(--shadow);
}

#apiLinks a i {
font-size: 0.9rem;
}

pre {
white-space: pre-wrap;
word-wrap: break-word;
overflow-x: auto;
background: var(--card-bg);
color: var(--text-primary);
padding: 1.25rem;
max-height: 400px;
font-size: 0.9rem;
font-weight: 500;
font-family: 'Fira Code', 'Poppins', monospace;
border-radius: var(--border-radius-sm);
border: 1px solid var(--border-color);
line-height: 1.5;
}

/* ===== Form Styles ===== */
.modal-body form label {
display: block;
font-weight: 500;
margin-bottom: 8px;
color: var(--text-primary);
font-size: 0.95rem;
}

.modal-body form input {
width: 100%;
padding: 14px 16px;
border: 1px solid var(--input-border);
background: var(--input-bg);
color: var(--text-secondary);
margin-bottom: 1rem;
font-weight: 500;
font-size: 0.95rem;
transition: var(--transition);
font-family: 'Poppins', sans-serif;
border-radius: var(--border-radius-sm);
box-shadow: var(--shadow-sm);
}

.modal-body form input::placeholder {
color: var(--placeholder-color);
font-weight: 400;
}

.modal-body form input:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

#submitParamBtn {
background: var(--primary);
color: white;
border: none;
padding: 16px 28px;
font-size: 1rem;
font-family: 'Poppins', sans-serif;
font-weight: 600;
cursor: pointer;
transition: var(--transition);
width: 100%;
margin-top: 1rem;
border-radius: var(--border-radius-sm);
box-shadow: var(--shadow-sm);
}

#submitParamBtn:hover {
background: var(--primary-dark);
transform: translateY(-2px);
box-shadow: var(--shadow);
}

#submitParamBtn:active {
transform: translateY(0);
box-shadow: var(--shadow-sm);
}

.loading-spinner {
margin: 2rem auto 1rem auto;
border: 3px solid rgba(99, 102, 241, 0.15);
border-top: 3px solid var(--primary);
border-radius: 50%;
width: 30px;
height: 30px;
animation: spin 0.8s linear infinite;
}

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

.title-container {
display: flex;
align-items: center;
gap: 16px;
margin-top: 5.5rem;
}

.icon-title {
font-size: 2.4rem;
color: var(--primary);
background: linear-gradient(135deg, var(--primary), var(--primary-dark));
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
}

/* ===== Modal Styles ===== */
.modal {
position: fixed;
top: 0;
left: 0;
z-index: 100;
width: 100vw;
height: 100vh;
background: var(--modal-overlay);
backdrop-filter: blur(10px);
display: flex;
align-items: center;
justify-content: center;
padding: 1rem;
opacity: 0;
pointer-events: none;
transition: opacity 0.3s ease;
}

.modal.active {
opacity: 1;
pointer-events: all;
}

.modal-dialog {
width: 100%;
max-width: 700px;
background: var(--card-bg);
padding: 2rem;
color: var(--text-primary);
overflow: hidden;
transform: translateY(30px);
transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
opacity: 0;
border-radius: var(--border-radius);
box-shadow: var(--shadow-lg);
border: 1px solid var(--border-color);
}

.modal.active .modal-dialog {
transform: translateY(0);
opacity: 1;
}

.modal-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
padding-bottom: 1.25rem;
border-bottom: 1px solid var(--border-color);
margin-bottom: 1.5rem;
}

.modal-header h5 {
font-size: 1.35rem;
font-weight: 600;
color: var(--text-secondary);
margin-bottom: 6px;
display: flex;
align-items: center;
gap: 10px;
}

.modal-header h5 .method-badge {
font-size: 0.85rem;
font-weight: 600;
padding: 0.3rem 0.6rem;
background: rgba(74, 222, 128, 0.15);
color: #22c55e;
border-radius: 16px;
text-transform: uppercase;
margin-right: 0;
}

.modal-header span {
font-size: 0.95rem;
color: var(--text-gray);
display: block;
font-weight: 400;
line-height: 1.5;
}

.btn-close {
background: none;
border: none;
font-size: 1.6rem;
line-height: 1;
cursor: pointer;
color: var(--text-gray);
transition: var(--transition);
padding: 0.3rem;
font-weight: 400;
opacity: 0.8;
}

.btn-close:hover {
color: var(--danger);
opacity: 1;
transform: rotate(90deg);
}

/* ===== Modal Body Content ===== */
.modal-body {
padding: 0.5rem 0;
}

/* Hide form and button when hide-form-elements class is present */
.modal-body.hide-form-elements #paramForm,
.modal-body.hide-form-elements #submitParamBtn {
display: none;
}

.copy-section {
display: none;
justify-content: space-between;
align-items: center;
gap: 10px;
background: var(--bg-lighter);
padding: 14px 18px;
font-size: 0.95rem;
color: var(--text-primary);
margin-bottom: 1.5rem;
overflow-x: auto;
font-weight: 500;
transition: var(--transition);
border-radius: var(--border-radius-sm);
border: 1px solid var(--border-color);
white-space: nowrap;
}

.copy-section::-webkit-scrollbar {
height: 6px;
}

.copy-section::-webkit-scrollbar-track {
background: var(--border-color);
border-radius: 10px;
}

.copy-section::-webkit-scrollbar-thumb {
background: var(--text-gray);
border-radius: 10px;
}

.copy-section::-webkit-scrollbar-thumb:hover {
background: var(--primary);
}

.copy-section.active {
display: flex;
animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}

#apiResponseContent {
background-color: var(--card-bg);
padding: 1.5rem;
border: 1px solid var(--border-color);
font-size: 0.95rem;
max-height: 450px;
overflow-y: auto;
margin-top: 20px;
white-space: pre-wrap;
word-wrap: break-word;
transition: var(--transition);
border-radius: var(--border-radius-sm);
line-height: 1.6;
}

#apiResponseContent::-webkit-scrollbar {
width: 6px;
height: 6px;
}

#apiResponseContent::-webkit-scrollbar-track {
background: var(--bg-lighter);
border-radius: 10px;
}

#apiResponseContent::-webkit-scrollbar-thumb {
background: var(--text-gray);
border-radius: 10px;
}

#apiResponseContent::-webkit-scrollbar-thumb:hover {
background: var(--primary);
}

.image-response {
max-width: 100%;
max-height: 350px;
display: block;
margin: 0 auto;
border-radius: var(--border-radius-sm);
box-shadow: var(--shadow-sm);
}

.video-response {
max-width: 100%;
height: auto;
border-radius: var(--border-radius-sm);
}
 
.audio-response {
width: 100%;
margin-top: 10px;
}

/* ===== Page Sections ===== */
.container {
max-width: 1400px;
margin: 5rem auto 2rem auto;
padding: 0 1.5rem;
}

header h1 {
font-size: 1.75rem;
font-weight: 700;
margin-bottom: 2rem;
color: var(--text-secondary);
}

.hero {
text-align: left;
margin: 3rem 0 4rem 0;
max-width: 900px;
}

.hero h2 {
font-size: 2.5rem;
font-weight: 700;
color: var(--text-secondary);
margin-bottom: 1rem;
background: linear-gradient(90deg, var(--primary), var(--primary-dark));
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
display: inline-block;
line-height: 1.2;
}

.hero p {
font-size: 1.15rem;
color: var(--text-gray);
margin-bottom: 2rem;
font-weight: 400;
line-height: 1.7;
}

.content h2 {
font-size: 1.8rem;
color: var(--text-secondary);
margin-bottom: 1.5rem;
font-weight: 600;
padding-bottom: 0.5rem;
border-bottom: 1px solid var(--border-color);
}

/* ===== Tabs ===== */
.tabs {
display: flex;
gap: 1rem;
overflow-x: auto;
margin-bottom: 2rem;
padding-bottom: 10px;
scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
display: none;
height: 0;
}

.tab {
background: none;
color: var(--text-gray);
border: none;
font-weight: 500;
font-family: 'Poppins', sans-serif;
border-bottom: 2px solid transparent;
padding: 0.5rem 0;
cursor: pointer;
font-size: 1rem;
white-space: nowrap;
position: relative;
transition: var(--transition);
}

.tab.active {
border-bottom: 3px solid var(--primary);
color: var(--primary-dark);
font-weight: 600;
}

.tab:after {
content: '';
position: absolute;
bottom: -3px;
left: 0;
width: 0;
height: 3px;
background: var(--primary);
transition: width 0.3s ease;
}

.tab:hover:not(.active):after {
width: 100%;
}

/* ===== API Card Animations ===== */
.api-list {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
gap: 1.5rem;
margin-bottom: 3rem;
}

/* ===== API Cards ===== */
.api-card {
background: var(--card-bg);
padding: 1.75rem;
transition: var(--transition);
display: flex;
justify-content: space-between;
align-items: center;
min-height: 40px;
opacity: 0;
transform: translateY(20px);
animation: cardEntrance 0.6s ease-out forwards;
position: relative;
overflow: hidden;
border-radius: var(--border-radius);
border: 1px solid var(--border-color);
box-shadow: var(--shadow-sm);
}

.api-card:hover {
transform: translateY(-5px);
box-shadow: var(--shadow-md);
border-color: var(--primary);
}

.api-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
transition: opacity 0.3s ease;
}

.api-card:hover::before {
opacity: 1;
}

.api-card:hover .play-button {
background: var(--primary-dark);
transform: translateX(3px);
}

.api-info {
flex: 1;
padding-right: 1.25rem;
}

.play-button {
background: var(--primary);
border: none;
padding: 12px 18px;
color: white;
cursor: pointer;
font-size: 0.95rem;
font-weight: 500;
transition: var(--transition);
display: flex;
align-items: center;
gap: 8px;
border-radius: var(--border-radius-sm);
box-shadow: var(--shadow-sm);
flex-shrink: 0;
}

@keyframes cardEntrance {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}

.api-info h3 {
font-size: 1.15rem;
color: var(--text-secondary);
font-weight: 600;
margin-bottom: 12px;
display: flex;
align-items: center;
gap: 10px;
}

.api-info h3 .method-badge {
font-size: 0.85rem;
font-weight: 600;
padding: 0.3rem 0.6rem;
margin-right: 0;
background: rgba(74, 222, 128, 0.15);
color: #22c55e;
border-radius: 16px;
text-transform: uppercase;
}

.api-info p {
font-size: 0.95rem;
color: var(--text-gray);
font-weight: 400;
line-height: 1.6;
}

.play-button:hover {
transform: translateY(-2px);
box-shadow: var(--shadow);
}

.play-button:active {
transform: translateY(0);
}

/* ===== Footer Styles ===== */
footer {
text-align: center;
padding: 3rem 1rem 2rem 1rem;
color: var(--text-gray);
font-size: 0.9rem;
border-top: 1px solid var(--border-color);
margin-top: 4rem;
}

footer .contact {
display: flex;
justify-content: center;
gap: 1.5rem;
margin-bottom: 2rem;
}

footer .contact a {
color: var(--text-gray);
text-decoration: none;
font-size: 1.5rem;
transition: var(--transition);
width: 50px;
height: 50px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
background: var(--bg-light);
box-shadow: var(--shadow-sm);
}

footer .contact a:hover {
color: white;
background: var(--primary);
transform: translateY(-4px);
box-shadow: var(--shadow);
}

/* ===== Search Input ===== */
.search-container {
margin: 2rem 0;
position: relative;
}

#searchInput {
padding: 14px 18px;
font-size: 1rem;
width: 100%;
max-width: 500px;
border-radius: var(--border-radius-sm);
border: 1px solid var(--border-color);
background: var(--input-bg);
color: var(--text-primary);
box-shadow: var(--shadow-sm);
transition: var(--transition);
}

#searchInput:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
.container {
max-width: 900px;
}

.hero h2 {
font-size: 2.2rem;
}

.hero p {
font-size: 1.05rem;
}
}

@media (max-width: 768px) {
body {
padding: 1rem;
}

.container {
margin-top: 4.5rem;
padding: 0 1rem;
}

.hero {
margin: 2rem 0 3rem 0;
}

.hero h2 {
font-size: 2rem;
}

.hero p {
font-size: 1rem;
margin-bottom: 1.5rem;
}

.api-list {
grid-template-columns: 1fr;
}

.modal-dialog {
padding: 1.5rem;
margin: 0 1rem;
}

.modal-header h5 {
font-size: 1.2rem;
}

.copy-section {
padding: 12px 16px;
}

#submitParamBtn {
padding: 14px 24px;
}

.api-card {
padding: 1.5rem;
}
}

@media (max-width: 480px) {
.hero h2 {
font-size: 1.8rem;
}

.modal-dialog {
padding: 1.25rem;
}

.api-info h3 {
font-size: 1.05rem;
}

.play-button {
padding: 10px 14px;
font-size: 0.9rem;
}

.title-container {
margin-top: 4.5rem;
}

footer .contact a {
width: 44px;
height: 44px;
font-size: 1.3rem;
}
}

/* Navbar Styles */
.navbar {
background: var(--bg-light);
border-bottom: 1px solid var(--border-color);
padding: 0.8rem 1.5rem;
position: fixed;
top: 0;
right: 0;
left: 0;
z-index: 1000;
backdrop-filter: blur(10px);
box-shadow: var(--shadow-sm);
height: var(--navbar-height);
}

.navbar-container {
display: flex;
align-items: center;
justify-content: space-between;
max-width: 1400px;
margin: 0 auto;
padding: 0 1rem;
height: 100%;
}

.slide-menu {
position: fixed;
top: 0;
right: -100%;
width: 280px;
height: 100%;
background: var(--card-bg);
box-shadow: -4px 0 12px rgba(0,0,0,0.2);
transition: right 0.3s ease;
z-index: 1000;
padding: 2rem 1.5rem;
overflow-y: auto;
}

.slide-menu.open {
right: 0;
}

.slide-menu a, .slide-menu button {
display: flex;
align-items: center;
gap: 12px;
width: 100%;
background: none;
border: none;
text-align: left;
padding: 14px 0;
font-size: 1rem;
color: var(--text-primary);
font-family: 'Poppins', sans-serif;
cursor: pointer;
transition: 0.2s;
text-decoration: none;
border-bottom: 1px solid var(--border-color);
}

.slide-menu a:hover, .slide-menu button:hover {
color: var(--primary);
}

.slide-menu a i, .slide-menu button i {
width: 24px;
text-align: center;
}

.brand {
font-size: 1.4rem;
font-weight: 700;
color: var(--text-secondary);
font-family: 'Poppins', sans-serif;
background: linear-gradient(90deg, var(--primary), var(--primary-dark));
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
}

.navbar-right {
display: flex;
align-items: center;
gap: 12px;
}

.navbar-right .nav-icon {
color: var(--primary);
font-size: 1.4rem;
text-decoration: none;
padding: 8px;
transition: var(--transition);
display: flex;
align-items: center;
justify-content: center;
width: 44px;
height: 44px;
border-radius: 50%;
background: rgba(99, 102, 241, 0.1);
box-shadow: var(--shadow-sm);
}

.navbar-right .nav-icon:hover {
color: white;
background: var(--primary-dark);
transform: translateY(-3px);
box-shadow: var(--shadow);
}

/* Theme Toggle Button */
#themeToggle {
background: none;
border: none;
cursor: pointer;
outline: none;
font-size: 1.4rem;
color: var(--text-gray);
padding: 8px;
width: 44px;
height: 44px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
transition: var(--transition);
box-shadow: var(--shadow-sm);
background: var(--bg-light);
}

#themeToggle:hover {
background: var(--card-hover-bg);
color: var(--primary-dark);
transform: translateY(-2px);
box-shadow: var(--shadow);
}

/* Method badges */
.method-badge {
font-size: 0.85rem;
font-weight: 600;
padding: 0.3rem 0.6rem;
border-radius: 16px;
text-transform: uppercase;
background: rgba(74, 222, 128, 0.15);
color: #22c55e;
}

.method-get { } 
.method-post { }
.method-put { }
.method-delete { }
.method-patch { }