@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.3.0/font/bootstrap-icons.css");

* {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #10a37f;
    --primary-hover: #0d8968;
    --secondary: #8b5cf6;
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --border: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-tertiary: #6e7681;
    --success: #3fb950;
    --danger: #f85149;
    --warning: #d29922;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* color: var(--text-primary); */
    line-height: 1.6;
}

/* Header */
.header {
    padding: 1rem 5%;
    width: 100%;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(8px);
    color: var(--text-primary);
}

.logo-part {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
}

.powerByAI {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.powerByAI h3 {
    border-radius: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.header-icon {
    border-radius: 8px;
    height: 40px;
    width: 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-icon:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--text-tertiary);
}

.header-icon i {
    font-size: 18px;
    color: inherit;
}

/* Popup */
#popup {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-secondary);
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    z-index: 2000;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#popup iframe {
    width: 100%;
    height: 600px;
    border: none;
    border-radius: 8px;
    background: white;
}

#popup button {
    width: auto;
    padding: 0.625rem 1.25rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

#popup button:hover {
    opacity: 0.9;
}

label {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

button {
    background: var(--primary);
    color: white;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

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

.btn-section {
    width: 90%;
    max-width: 1400px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    margin-top: 1.5rem;
}

.toggle-btn {
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.625rem 1rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--text-tertiary);
}

.toggle-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.main {
    width: 90%;
    max-width: 1400px;
    padding: 2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
}

.main h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.authorization {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.authorization input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9375rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.authorization input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.authorization input::placeholder {
    color: var(--text-tertiary);
}

.normal-input-wrap {
    width: 100%;
    min-width: 280px;
    max-width: 400px;
    display: flex;
    flex-direction: column;
}

.normal-file-wrap {
    width: 100%;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.normal-input-wrap input,
.normal-input-wrap select,
.normal-input-wrap textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9375rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.normal-input-wrap input:focus,
.normal-input-wrap select:focus,
.normal-input-wrap textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.normal-input-wrap input::placeholder,
.normal-input-wrap textarea::placeholder {
    color: var(--text-tertiary);
}

.normal-input-wrap select {
    cursor: pointer;
}

.normal-input-wrap select option {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.info {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding: 1.25rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
}

#result,
#resultScreen,
.apiResponseForm {
    width: 100%;
    /* min-height: 60px; */
}

.response-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    margin-bottom: 0.625rem;
    font-size: 0.875rem;
}

.info textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.responseInformation {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0.75rem;
    padding: 1.25rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.terms {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
}

.terms p {
    color: var(--text-secondary);
    margin: 0;
}

.terms input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.terms a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

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

.toggle-btn i {
    font-size: 14px;
    margin-right: 4px;
}

@media screen and (max-width: 768px) {
    .title {
        display: none;
    }
    
    .btn-section,
    .main {
        width: 95%;
        padding: 1rem;
    }
    
    .main h2 {
        font-size: 1.5rem;
    }
    
    .normal-input-wrap {
        max-width: 100%;
    }
}

@media screen and (max-width: 450px) {
    .header {
        padding: 1rem 3%;
    }
    
    .powerByAI h3 {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }
}

/* Action Button */
.ActionBtn {
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.ActionBtn:hover {
    opacity: 0.9;
}

.buttonsHolder {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Loading State */
.loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary);
    font-weight: 500;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* File Input */
input[type="file"] {
    padding: 0.75rem;
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    margin-right: 0.75rem;
    transition: all 0.2s ease;
}

input[type="file"]::file-selector-button:hover {
    background: var(--bg-primary);
}

/* Links */
a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    opacity: 0.8;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-primary);
}

table th {
    background: var(--bg-tertiary);
    padding: 0.625rem;
    text-align: left;
    font-weight: 500;
    border: 1px solid var(--border);
    font-size: 0.875rem;
}

table td {
    padding: 0.5rem;
    border: 1px solid var(--border);
}

table td input {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: 4px;
    width: 100%;
    font-size: 0.875rem;
}

table td input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Popup Modals */
#soPopup,
#ticketPopup,
#matchPopup {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

#soPopup > div,
#ticketPopup > div,
#matchPopup > div {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
}

/* #soPopupContent,
#ticketPopupContent,
#matchPopupContent {
    color: var(--text-primary);
} */

/* Copyright footer */
body > p:last-child {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    padding: 1rem;
    text-align: center;
}

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

#loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-logo {
    width: 120px;
    height: 120px;
    animation: logoAnimation 2.5s ease-in-out forwards;
    transform-origin: center;
}

.loading-text {
    margin-top: 2rem;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    opacity: 0;
    animation: fadeInOut 2.5s ease-in-out forwards;
}

/* Main logo animation: spin → grow → fade out */
@keyframes logoAnimation {
    0% {
        transform: scale(0.3) rotate(0deg);
        opacity: 0;
    }
    20% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
    60% {
        transform: scale(1) rotate(720deg);
        opacity: 1;
    }
    80% {
        transform: scale(1.5) rotate(900deg);
        opacity: 0.5;
    }
    100% {
        transform: scale(3) rotate(1080deg);
        opacity: 0;
    }
}

/* Text fade in and out */
@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    20% {
        opacity: 1;
        transform: translateY(0);
    }
    70% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Optional: Add a subtle glow effect */
.loading-logo {
    filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.3));
}