/* General Body & Font Styles */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #f0f0f0; /* Page background color for spacing */
    color: #212529;
    margin: 0;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

/* Common styles for all bordered boxes */
.site-header,
.main-content,
.blockchain-data,
.site-footer {
    width: 100%;
    max-width: 960px;
    background-color: #ffffff; /* White background inside boxes */
    border: 1px solid #000;
    box-sizing: border-box;
    margin-bottom: 2rem; /* This creates the space between boxes */
}

/* Header Styles */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* NEW: Style for the branding link */
.branding-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
}

.site-logo {
    height: 50px;
    width: auto;
}

.site-title {
    font-family: 'Roboto', sans-serif;
    font-size: 48px; 
    margin: 0;
    font-weight: 900;
    line-height: 1; /* Adjusts line height for tighter vertical alignment */
}

.switch-coin-container {
    /* This empty rule is a placeholder for potential future desktop styles */
}

#coin-select {
    padding: 0.5rem;
    border: 1px solid #000;
    font-size: 1rem;
    min-width: 150px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Main Content Styles */
.main-content {
    padding: 2rem;
    text-align: center;
}

.main-content h1 {
    font-family: 'Roboto', sans-serif;
    font-weight: 550;
    font-size: 1.6rem;
    margin-top: 0;
}

.main-content h2 {
    font-family: 'Roboto', sans-serif;
    font-weight: 550;
    font-size: 1.6rem;
    margin-top: 0;
}

.intro-text {
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: #495057;
    text-align: left;
}

/* Calculators Grid */
.calculators-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.calculator-card {
    border: 1px solid #000;
    padding: 1rem;
    display: flex;
    flex-direction: row; 
    align-items: center; 
    justify-content: flex-start;
    gap: 0.75rem;
    transition: background-color 0.2s ease-in-out;
    text-decoration: none;
    color: inherit;
}

.calculator-card:hover {
    background-color: #f1f1f1;
}

.calculator-card span {
    font-size: 1.2rem;
    font-weight: 700;
}

.card-image {
    height: 40px;
    width: 40px;
}

/* NEW: Disclaimer Box Styles */
.disclaimer-box {
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    border: 1px solid transparent;
    border-radius: .25rem;
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
    text-align: left;
}

.disclaimer-box-red {
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    border: 1px solid transparent;
    border-radius: .25rem;
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f8d7da;
    text-align: left;
}


.disclaimer-box strong {
    font-weight: bold;
}

/* Blockchain Data Section */
.blockchain-data {
    padding: 2rem;
}

.blockchain-data h2 {
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
    text-align: center; 
}

.blockchain-data table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.blockchain-data th,
.blockchain-data td {
    border: 1px solid #ccc;
    padding: 0.75rem;
    text-align: left;
    vertical-align: middle; 
    white-space: nowrap;
}

.blockchain-data th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.blockchain-cell {
    display: flex;
    align-items: center; 
}

.blockchain-icon {
    height: 24px;
    width: 24px;  
    margin-right: 0.5rem; 
}

/* Footer Styles */
.site-footer {
    padding: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0; 
}

.footer-nav {
    margin-bottom: 1rem;
}

.footer-nav a {
    color: #212529;
    text-decoration: none;
    margin: 0 0.25rem;
}

.footer-nav a:hover {
    text-decoration: underline;
}

.site-footer p {
    margin: 0.5rem 0;
}


/* Responsive Adjustments */
@media (max-width: 768px) {
    /* CHANGED: Switched to a single column to prevent text wrapping issues */
    .calculators-grid {
        grid-template-columns: 1fr;
    }
    .site-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .site-logo {
        height: 40px;
    }
    .site-title {
        font-size: 32px;
    }

    .switch-coin-container {
        width: 100%;
    }

    #coin-select {
        width: 100%;
    }


    /* === START: RESPONSIVE TABLE STYLES === */
    
    .blockchain-data {
        overflow-x: initial; 
    }

    .blockchain-data thead {
        display: none;
    }

    .blockchain-data tr {
        display: block;
        border: 1px solid #ccc;
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .blockchain-data tr:last-of-type {
        margin-bottom: 0;
    }

    .blockchain-data td {
        display: block;
        border: none;
        padding: 0.5rem 0;
        text-align: right; 
        border-bottom: 1px solid #eee;
    }

    .blockchain-data td:last-of-type {
        border-bottom: none;
    }
    
    .blockchain-data td::before {
        content: attr(data-label);
        float: left; 
        font-weight: bold;
        text-align: left;
        white-space: nowrap;
    }

    .blockchain-data td[data-label="Blockchain"] .blockchain-cell {
       justify-content: flex-end; 
    }

    /* === END: RESPONSIVE TABLE STYLES === */
}

/* This media query is no longer needed as the 768px one handles it */
/*
@media (max-width: 600px) {
    .calculators-grid {
        grid-template-columns: 1fr; 
    }
}
*/


@media (max-width: 480px) {
    body {
        padding: 1rem;
    }
    .site-header,
    .main-content,
    .blockchain-data,
    .site-footer {
        margin-bottom: 1.5rem;
    }
	
	.main-content h1 {
    font-family: 'Roboto', sans-serif;
    font-weight: 550;
    font-size: 1.4rem;
    margin-top: 0;
}

    .main-content h2 {
    font-family: 'Roboto', sans-serif;
    font-weight: 550;
    font-size: 1.4rem;
    margin-top: 0;
}

    .site-logo {
        height: 35px;
    }
    .site-title {
        font-size: 24px;
    }

    .blockchain-icon {
        height: 20px;
        width: 20px;
    }
}