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

:root {
    --primary-color: #00f5a0;
    --primary-dark: #00d187;
    --secondary-color: #2d2d3a;
    --background-color: #1a1a2e;
    --card-background: #252542;
    --text-primary: #ffffff;
    --text-secondary: #a0a0c0;
    --border-color: #3a3a5a;
    --success-color: #00f5a0;
    --warning-color: #ffd166;
    --error-color: #ef476f;
    --coingecko-color: #8bc53f;
    --coinpaprika-color: #ff8c00;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--background-color) 0%, #16213e 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: rgba(37, 37, 66, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

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

.blog_link {
    visibility: hidden;
}

.logo-icon {
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(239, 71, 111, 0.1);
    color: var(--error-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid rgba(239, 71, 111, 0.3);
}

.pulse {
    width: 8px;
    height: 8px;
    background: var(--error-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        opacity: 1;
    }
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, rgba(0, 245, 160, 0.1) 0%, rgba(37, 37, 66, 0.3) 100%);
    padding: 3rem 0;
    text-align: center;
}

.hero h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), #00d9ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pi-auth-button {
    background: linear-gradient(135deg, #00f5a0, #00d187);
    color: #2d2d3a;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pi-auth-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 245, 160, 0.3);
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.api-status {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 20px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.status-item i {
    color: var(--primary-color);
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    background: var(--card-background);
    border-radius: 15px;
    padding: 8px;
    margin: 2rem 0;
    border: 1px solid var(--border-color);
    gap: 8px;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-button.active {
    background: var(--primary-color);
    color: var(--secondary-color);
    box-shadow: 0 4px 15px rgba(0, 245, 160, 0.3);
}

.tab-button:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Converter Card */
.converter-card {
    background: var(--card-background);
    border-radius: 20px;
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
}

.price-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.price-header h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.card-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

.price-display {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.loading-price {
    color: var(--text-secondary);
    font-style: italic;
}

.live-price {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.price-sources {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.refresh-btn {
    background: var(--secondary-color);
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.refresh-btn:hover {
    background: var(--primary-color);
    color: var(--secondary-color);
}

.refresh-btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Converter Form */
.converter-form {
    max-width: 600px;
    margin: 0 auto 2rem;
}

.loan-form {
    max-width: 800px;
    margin: 0 auto 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 245, 160, 0.1);
}

/* Input Grid for Loan Calculator */
.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.input-with-currency,
.term-input {
    display: flex;
    gap: 10px;
}

.input-with-currency input,
.term-input input {
    flex: 1;
}

.input-with-currency select,
.term-input select {
    width: 100px;
}

.currency-row {
    display: flex;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.currency-group {
    flex: 1;
}

.swap-button {
    background: var(--secondary-color);
    border: none;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.swap-button:hover {
    background: var(--primary-color);
    color: var(--secondary-color);
    transform: rotate(180deg);
}

.convert-button {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: 12px;
    color: var(--secondary-color);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.convert-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 245, 160, 0.4);
}

/* Results */
.result-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 2rem;
    margin-top: 1rem;
    text-align: center;
}

.result-placeholder {
    color: var(--text-secondary);
    font-style: italic;
}

.result-placeholder i {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.conversion-result {
    text-align: center;
}

.conversion-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.conversion-detail {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.conversion-rate {
    color: var(--text-secondary);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Loan Results */
.loan-results {
    text-align: left;
}

.loan-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.loan-metric {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.metric-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Amortization Section */
.amortization-section {
    margin-top: 2rem;
}

.amortization-section h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    text-align: center;
}

.amortization-table-container {
    overflow-x: auto;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.amortization-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.02);
}

.amortization-table th,
.amortization-table td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.amortization-table th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-weight: 600;
    position: sticky;
    top: 0;
}

.amortization-table th:first-child,
.amortization-table td:first-child {
    text-align: left;
}

.amortization-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.table-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    background: var(--secondary-color);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.action-btn:hover {
    background: var(--primary-color);
    color: var(--secondary-color);
}

/* Rate Details */
.rate-details {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.rate-details h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.rate-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.rate-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.rate-info .label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.rate-info .value {
    color: var(--text-primary);
    font-weight: 500;
}

/* Market Data */
.market-data {
    margin: 3rem 0;
}

.market-data h3 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.crypto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.crypto-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.crypto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.crypto-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
}

.crypto-icon {
    width: 32px;
    height: 32px;
}

/* Crypto Icons */
.btc-icon,
.eth-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

.btc-icon {
    background: #f7931a;
    /* Bitcoin orange */
}

.eth-icon {
    background: #627eea;
    /* Ethereum blue */
}

.pi-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
    font-weight: bold;
}

.crypto-name {
    font-weight: 600;
    color: var(--text-primary);
}

.crypto-price {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.crypto-change {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.crypto-change.positive {
    color: var(--success-color);
}

.crypto-change.negative {
    color: var(--error-color);
}

/* Info Sections */
.info-sections {
    display: grid;
    gap: 2rem;
}

.info-section {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 15px;
}

.info-section h4 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-section ul {
    list-style: none;
    margin-top: 1rem;
}

.info-section li {
    padding: 8px 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 20px;
}

.info-section li:before {
    content: "✓";
    color: var(--primary-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Footer */
.footer {
    background: var(--card-background);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.tool-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tool-badge {
    background: var(--primary-color);
    color: var(--secondary-color);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.footer-note {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h2 {
        font-size: 2rem;
    }

    .converter-card {
        padding: 1.5rem;
    }

    .tab-navigation {
        flex-direction: column;
    }

    .currency-row {
        flex-direction: column;
    }

    .swap-button {
        align-self: center;
        transform: rotate(90deg);
        margin: 0.5rem 0;
    }

    .price-display {
        font-size: 2rem;
    }

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

    .api-status {
        flex-direction: column;
        align-items: center;
    }

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

    .loan-summary {
        grid-template-columns: 1fr;
    }

    .amortization-table th,
    .amortization-table td {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .price-sources {
        flex-direction: column;
        text-align: center;
    }

    .table-actions {
        flex-direction: column;
    }
}

/* Notification animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Loading spinner */
.fa-spinner {
    animation: spin 1s linear infinite;
}