:root {
    --primary-color: #4361ee;
    --primary-light: #4895ef;
    --primary-dark: #3f37c9;
    --secondary-color: #f72585;
    --text-color: #2b2d42;
    --text-light: #8d99ae;
    --background-color: #f8f9fa;
    --card-bg: rgba(255, 255, 255, 0.85);
    --success-color: #06d6a0;
    --error-color: #ef476f;
    --border-radius: 16px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Poppins", sans-serif;
    background: linear-gradient(135deg, #4361ee, #3a0ca3);
    color: var(--text-color);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

.page-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    width: 100%;
    max-width: 900px;
    padding: 40px;
    margin: 40px auto;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.app-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.app-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0;
}

.subtitle {
    color: var(--text-light);
    font-size: 1rem;
    margin-top: 8px;
}

.search-section {
    margin-bottom: 30px;
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
}

.input-group {
    display: flex;
    gap: 10px;
    position: relative;
}

input[type="text"] {
    flex: 1;
    padding: 16px 20px;
    font-size: 1rem;
    border-radius: 12px;
    border: 2px solid rgba(0, 0, 0, 0.05);
    background: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    transition: var(--transition);
    outline: none;
}

input[type="text"]:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.pulse-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 25px;
    height: 56px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
    white-space: nowrap;
}

.pulse-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.4);
}

.button-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.pulse-button:hover .button-icon {
    transform: translateX(4px);
}

.pulse-button:disabled {
    background-color: #cbd5e1;
    color: #ffffff;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    opacity: 0.6;
}

.results-wrapper {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
}

.section-title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--primary-color);
    margin-right: 10px;
    border-radius: 4px;
}

.result-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    min-height: 200px;
    word-break: break-word;
}

.placeholder-text {
    color: var(--text-light);
    text-align: center;
    padding: 30px 0;
}

.hint {
    font-size: 0.85rem;
    margin-top: 10px;
    opacity: 0.7;
}

.json-container {
    background: #1e293b;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
}

.json-output {
    color: #e2e8f0;
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    overflow-x: auto;
    padding: 25px;
    min-height: 200px;
    background: linear-gradient(to bottom, #1e293b, #0f172a);
    border-radius: 12px;
    line-height: 1.5;
}

.error {
    color: var(--error-color);
    font-weight: 600;
    padding: 10px 0;
    display: flex;
    align-items: center;
}

.error::before {
    content: "❌";
    margin-right: 8px;
}

.success {
    color: var(--success-color);
    font-weight: 600;
    padding: 10px 0;
    display: flex;
    align-items: center;
}

.success::before {
    content: "✅";
    margin-right: 8px;
}

hr {
    border: 0;
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin: 10px 0;
}

.app-footer {
    text-align: center;
    margin-top: 40px;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Animation for loading state */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.loading {
    animation: pulse 1.5s infinite;
}

.copy-icon {
    position: absolute;
    right: 20px;
    top: 20px;
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.3s;
    z-index: 10;
}

.copy-icon:hover {
    color: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .glass-card {
        padding: 25px;
    }

    .app-header h1 {
        font-size: 1.8rem;
    }

    .input-group {
        flex-direction: column;
    }

    .pulse-button {
        width: 100%;
    }
}

.copy-icon img {
    content: url("img/copy.svg");
    width: 20px;
    height: 20px;
    transition: filter 0.3s ease;
}

.copy-icon:hover img {
    content: url("img/copy-hover.svg");
}
.auth-container {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1000;
}

.auth-button {
    background: none;
    border: none;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.auth-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-info {
    color: white;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.credits {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
}

/* Modal styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal h3 {
    margin-bottom: 20px;
    color: var(--primary-dark);
    text-align: center;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

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

.modal-button.secondary {
    background: #f1f5f9;
    color: var(--text-color);
}

.modal-button.secondary:hover {
    background: #e2e8f0;
}

.error-message {
    color: var(--error-color);
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.credit-packages {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 25px 0;
}

.credit-package {
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    background-color: #ffffff;
}

.credit-package:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.2);
}

.package-credits {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.package-price {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 5px;
}

.credits-container {
    display: flex;
    align-items: center;
    gap: 10px;
}
.credits-container .auth-button {
    padding: 6px 12px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.2);
}
.credits-container .auth-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal {
    max-width: 600px;
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: 90vh;
}

.modal-header {
    padding: 10px 10px 10px 10px;
    border-bottom: 1px solid #e2e8f0;
}
.modal-header h3 {
    text-align: center;
    color: var(--primary-dark);
    margin: 0;
}
.modal-body {
    padding: 10px 15px;
    overflow-y: auto;
    flex-grow: 1;
}
.modal-footer {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #e2e8f0;
}
.modal-footer .modal-button {
    flex: 1;
}

.stepper {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}
.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-light);
    font-size: 0.8rem;
    width: 33.3%;
    cursor: pointer;
}
.step-item .step-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 5px;
    transition: var(--transition);
}
.step-item .step-name {
    transition: var(--transition);
}
.step-item.active .step-circle {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}
.step-item.active .step-name {
    color: var(--primary-dark);
    font-weight: 500;
}
.step-item.completed .step-circle {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.step-item:not(.active):not(.completed) {
}

.modal-step {
    display: none;
}
.modal-step.active {
    display: block;
}

.payment-instructions {
    text-align: left;
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}
.payment-instructions hr {
    border: 0;
    height: 1px;
    background: #e2e8f0;
    margin: 15px 0;
}
.payment-instructions strong {
    color: var(--text-color);
}
.payment-instructions .iban,
.payment-instructions .amount {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-dark);
    word-break: break-all;
}
.payment-instructions .unique-code {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--error-color);
    background: #fff0f3;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    letter-spacing: 1px;
    margin: 10px 0;
}
.payment-instructions .hint {
    font-size: 0.9rem;
    color: var(--text-light);
}

.loader {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.credits-container {
    display: flex;
    align-items: center;
    gap: 10px;
}
.credits-container .auth-button {
    padding: 6px 12px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.2);
}
.credits-container .auth-button:hover {
    background: rgba(255, 255, 255, 0.3);
}
.modal {
    max-width: 600px;
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: 90vh;
}
.modal-header {
    padding: 25px 25px 15px 25px;
    border-bottom: 1px solid #e2e8f0;
}
.modal-header h3 {
    text-align: center;
    color: var(--primary-dark);
    margin: 0;
}
.modal-body {
    padding: 20px 25px;
    overflow-y: auto;
    flex-grow: 1;
}
.modal-footer {
    display: flex;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid #e2e8f0;
}
.modal-footer .modal-button {
    flex: 1;
}
.stepper {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}
.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-light);
    font-size: 0.8rem;
    width: 33.3%;
    cursor: pointer;
}
.step-item .step-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 5px;
    transition: var(--transition);
}
.step-item .step-name {
    transition: var(--transition);
}
.step-item.active .step-circle {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}
.step-item.active .step-name {
    color: var(--primary-dark);
    font-weight: 500;
}
.step-item.completed .step-circle {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}
.modal-step {
    display: none;
}
.modal-step.active {
    display: block;
}
.payment-instructions {
    text-align: left;
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}
.payment-instructions hr {
    border: 0;
    height: 1px;
    background: #e2e8f0;
    margin: 15px 0;
}
.payment-instructions strong {
    color: var(--text-color);
}
.payment-instructions .iban,
.payment-instructions .amount {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-dark);
    word-break: break-all;
}
.payment-instructions .unique-code {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--error-color);
    background: #fff0f3;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    letter-spacing: 1px;
    margin: 10px 0;
}
.payment-instructions .hint {
    font-size: 0.9rem;
    color: var(--text-light);
}
.loader {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
.form-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: none;
}
.form-message.success {
    background-color: #e6f9f1;
    color: var(--success-color);
    border: 1px solid var(--success-color);
}
.form-message.error {
    background-color: #fff0f3;
    color: var(--error-color);
    border: 1px solid var(--error-color);
}
.switch-modal-link {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
}
.switch-modal-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}
.g-recaptcha {
    margin-top: 15px;
    display: flex;
    justify-content: center;
}

#historyModal .modal {
    width: 75vw;
    max-width: 1400px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
#historyModal .modal-body {
    padding-top: 0;
    min-height: 400px;
    position: relative;
    overflow-y: hidden;
}
#historyModal .modal-footer {
    justify-content: space-between;
    align-items: center;
}
.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.9rem;
}
.history-table th,
.history-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    color: var(--text-color);
    vertical-align: top;
}
.history-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--text-light);
    position: sticky;
    top: 0;
}

.history-table th:first-child,
.history-table td:first-child {
    width: 1%;
    white-space: nowrap;
}
.history-table th:last-child {
    width: 99%;
}

.history-table td {
    background-color: #ffffff;
    word-break: break-word;
}
.history-date {
    font-size: 0.8rem;
    color: var(--text-light);
    display: block;
    margin-top: 4px;
}
.history-table tr:last-child td {
    border-bottom: none;
}
.history-table-container {
    max-height: 400px;
    overflow-y: auto;
}

#historyLoader {
    display: none;
}

.pagination-controls {
    text-align: left;
    flex-grow: 1;
}
.pagination-controls button,
.pagination-controls span {
    margin: 0 3px;
    padding: 8px 12px;
    border: none;
    background: #f1f5f9;
    color: var(--text-color);
    border-radius: 8px;
    cursor: pointer;
}
.pagination-controls button:disabled {
    background: var(--primary-color);
    color: white;
    cursor: default;
}
.pagination-controls span {
    background: none;
    cursor: default;
}
.history-total {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-left: 15px;
}
.back-button-container {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
}
.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    text-align: center;
}
.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}
.countdown {
    font-weight: bold;
    color: var(--primary-color);
}
.quarantine-box {
    background-color: rgba(220, 53, 69, 0.1); 
    border: 1px solid rgba(220, 53, 69, 0.3); 
    color: #b02a37;
    padding: 10px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 0.9rem;
}
.ip-address {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 1px;
}
.cache-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.9rem;
}
.cache-warning strong {
    font-weight: 600;
}
@media (max-width: 768px) {
    .page-container {
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 20px;
        height: auto;
        min-height: 100vh;
    }

    .auth-container {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        justify-content: center;
        margin-bottom: 20px;
        padding: 0 10px;
        flex-wrap: wrap;
        background: transparent;
    }

    .user-info {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        background: rgba(255, 255, 255, 0.15);
        padding: 10px 20px;
        border-radius: 12px;
        width: 100%;
        max-width: 400px;
    }

    .auth-button {
        width: auto;
        min-width: 120px;
        text-align: center;
        padding: 8px 16px;
        background: rgba(255, 255, 255, 0.2);
    }

    .glass-card {
        margin: 0 auto 40px auto;
        width: 100%;
    }

    #historyModal .modal {
        width: 95%;
        max-width: 95%;
        height: 85vh;
        max-height: 85vh;
        padding: 15px;
        display: flex;
        flex-direction: column;
    }

    #historyModal .modal-body {
        padding: 10px 5px;
        overflow-y: hidden;
        display: flex;
        flex-direction: column;
        flex: 1;
    }

    .history-table-container {
        overflow-x: auto;
        flex-grow: 1;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        height: 100%;
    }

    .history-table {
        min-width: 600px;
        width: 100%;
    }

    .history-table th, 
    .history-table td {
        white-space: normal;
        padding: 8px;
        font-size: 13px !important;
        line-height: 1.4 !important;
        -webkit-text-size-adjust: none;
        -moz-text-size-adjust: none;
        -ms-text-size-adjust: none;
        text-size-adjust: none;
        max-height: 999999px;
    }
    
    .history-table td span {
        font-size: 12px !important;
        -webkit-text-size-adjust: none;
    }

    #historyModal .modal-footer {
        flex-direction: column;
        gap: 15px;
        padding: 15px 10px;
        flex-shrink: 0;
    }

    .pagination-controls {
        display: flex;
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 5px;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
    }

    .pagination-controls button,
    .pagination-controls span {
        flex-shrink: 0;
    }

    .history-total {
        text-align: center;
        margin: 0;
        font-size: 0.8rem;
    }

    #historyModal .modal-button {
        width: 100%;
    }
}