/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1a202c;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    min-height: 100vh;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 40px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
}

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

.logo i {
    font-size: 28px;
    color: #3182ce;
}

.logo .knotapi-logo {
    width: 40px;
    height: 40px;
    margin-right: 12px;
    object-fit: contain;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: #000000;
    font-family: 'Inter', sans-serif;
}

.subtitle {
    color: #718096;
    font-size: 16px;
    font-weight: 400;
}

.back-btn, .refresh-btn {
    background: #000000;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.back-btn:hover, .refresh-btn:hover {
    background: #333333;
    transform: translateY(-1px);
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Main Content */
    .main-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 0 40px;
    }

    @media (max-width: 768px) {
        .main-content {
            padding: 0 20px;
        }
    }

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 48px;
    padding: 40px 0;
}

.hero-title {
    font-size: 36px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-description {
    font-size: 18px;
    color: #4a5568;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Merchants Grid */
.merchants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.merchant-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.merchant-card:hover {
    transform: translateY(-4px);
    border-color: #000000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.merchant-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: #000000;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
}

.merchant-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: #000000;
    margin-bottom: 8px;
}

.merchant-card p {
    color: #4a5568;
    font-size: 14px;
    font-weight: 400;
}

/* Login Page Styles */
.login-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.login-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 48px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.merchant-info {
    text-align: center;
    margin-bottom: 40px;
}

.merchant-logo-large {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    background: #000000;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
}

.merchant-info h2 {
    font-size: 28px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 8px;
}

.merchant-description {
    color: #4a5568;
    font-size: 16px;
}

.login-form {
    margin-bottom: 32px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #1a202c;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.form-group input:focus {
    outline: none;
    border-color: #000000;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #4a5568;
}

.checkbox-container input {
    margin-right: 8px;
    width: auto;
}

.forgot-password {
    color: #000000;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.forgot-password:hover {
    text-decoration: underline;
}

.login-btn {
    width: 100%;
    background: #000000;
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    background: #333333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.demo-note {
    background: #e6fffa;
    border: 1px solid #81e6d9;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #234e52;
    font-size: 14px;
}

.demo-note i {
    color: #38b2ac;
    font-size: 16px;
}

/* Transactions Page Styles */
.transactions-main {
    flex: 1;
    padding-bottom: 40px;
}

.merchant-header {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 16px;
}

.merchant-info-small {
    display: flex;
    align-items: center;
    gap: 16px;
}

.merchant-logo-small {
    width: 50px;
    height: 50px;
    background: #000000;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.merchant-info-small h2 {
    font-size: 20px;
    font-weight: 600;
    color: #000000;
    margin-bottom: 4px;
}

.account-info {
    color: #4a5568;
    font-size: 14px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #38a169;
    font-weight: 500;
    font-size: 14px;
}

.connection-status i {
    font-size: 16px;
}

.transactions-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.summary-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.summary-card h3 {
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-card .amount {
    font-size: 28px;
    font-weight: 700;
    color: #1a202c;
}

.summary-card .count {
    font-size: 28px;
    font-weight: 700;
    color: #000000;
}

.summary-card .date {
    font-size: 16px;
    font-weight: 500;
    color: #4a5568;
}

.transactions-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #000000;
}

.filter-options select {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #4a5568;
    font-size: 14px;
    cursor: pointer;
}

.transactions-list {
    max-height: 500px;
    overflow-y: auto;
}

.transaction-item {
    display: flex;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-item:hover {
    background: #f8fafc;
    margin: 0 -24px;
    padding: 20px 24px;
    border-radius: 12px;
}

.transaction-icon {
    width: 48px;
    height: 48px;
    background: #000000;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    font-size: 20px;
    color: white;
}

.transaction-details {
    flex: 1;
}

.transaction-title {
    font-size: 16px;
    font-weight: 500;
    color: #000000;
    margin-bottom: 4px;
}

.transaction-description {
    font-size: 14px;
    color: #4a5568;
    margin-bottom: 4px;
}

.transaction-date {
    font-size: 12px;
    color: #718096;
}

.transaction-amount {
    font-size: 18px;
    font-weight: 600;
    color: #000000;
    text-align: right;
}

.transaction-amount.positive {
    color: #38a169;
}

.transaction-amount.negative {
    color: #e53e3e;
}

/* Footer */
.footer {
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
    padding: 20px 0;
    text-align: center;
    color: #4a5568;
    font-size: 14px;
    margin-top: auto;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 0;
    }

    .header {
        padding: 16px 20px;
        margin-bottom: 20px;
        width: 100%;
    }

    .logo h1 {
        font-size: 20px;
    }

    .subtitle {
        font-size: 14px;
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-description {
        font-size: 16px;
        padding: 0 16px;
    }

    .merchants-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 16px;
    }

    .merchant-card {
        padding: 24px 20px;
    }

    .login-container {
        padding: 32px 24px;
        margin: 0 16px;
    }

    .merchant-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .transactions-summary {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .transaction-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .transaction-amount {
        text-align: left;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 12px 16px;
        width: 100%;
    }

    .main-content {
        padding: 0 16px;
    }

    .merchants-grid {
        grid-template-columns: 1fr;
    }

    .merchant-card {
        padding: 20px 16px;
    }

    .login-container {
        padding: 24px 20px;
        margin: 0 8px;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* Scrollbar Styling */
.transactions-list::-webkit-scrollbar {
    width: 6px;
}

.transactions-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.transactions-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.transactions-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
