.mac-container {
    max-width: 720px;
    margin: 2rem auto;
    padding: 2rem 2.5rem;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #fff; /* white text */
}

.mac-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.6rem;
}

@media (min-width: 700px) {
    .mac-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.mac-field {
    display: flex;
    flex-direction: column;
}

.mac-field label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: #fff;
}

.mac-field input[type="number"],
.mac-field input[type="text"] {
    padding: 0.65rem 1rem;
    border: 1.8px solid #666;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.mac-field input[type="number"]:focus,
.mac-field input[type="text"]:focus {
    border-color: #d99a21;
    box-shadow: 0 0 8px #d99a21cc;
    outline: none;
}

.mac-full {
    grid-column: span 2;
    text-align: center;
}

.mac-button {
    background-color: #a7151d;
    color: #fff;
    font-weight: 700;
    padding: 1.1rem 2.4rem;
    font-size: 1.2rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.25s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 15px #a7151dcc;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    display: block;
}

.mac-button:hover,
.mac-button:focus {
    background-color: #7e1014;
    box-shadow: 0 6px 20px #7e1014cc;
    outline: none;
}

.mac-results {
    margin-top: 2rem;
    padding: 1.6rem 2.2rem;
    border-radius: 14px;
    background: #222222;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
    animation: fadeIn 0.4s ease-in-out;
    font-size: 1.15rem;
    color: #fff;
}

.mac-results p {
    margin: 0.5rem 0;
}

.mac-results strong {
    color: #d99a21;
}

.text-green {
    color: #34d399;
    font-weight: 700;
}

.text-red {
    color: #ef4444;
    font-weight: 700;
}

.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced mobile and small screen responsiveness */
@media (max-width: 600px) {
    .mac-container {
        margin: 1rem auto;      /* center horizontally */
        padding: 1.2rem 1.2rem;
        max-width: 90%;         /* widen to 90% of screen */
        width: 90%;             /* ensure width is 90% */
    }

    .mac-grid {
        grid-template-columns: 1fr !important; /* single column */
        gap: 1.2rem;
    }

    .mac-field label {
        font-size: 0.95rem;
        margin-bottom: 0.3rem;
    }

    .mac-field input[type="number"],
    .mac-field input[type="text"] {
        font-size: 1rem;
        padding: 0.65rem 0.9rem;
        border-radius: 8px;
    }

    .mac-button {
    font-size: 1.1rem;
    padding: 1rem 1.6rem;
    max-width: 100%;
    background-color: #a7151d;
    color: #fff;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(167, 21, 29, 0.8);
    transition: 
        background-color 0.3s ease, 
        box-shadow 0.3s ease, 
        transform 0.2s ease;
}

.mac-button:hover,
.mac-button:focus {
    background-color: #7e1014;
    box-shadow: 0 6px 20px rgba(126, 16, 20, 0.9);
    outline: none;
    transform: scale(1.05);
}


    .mac-results {
        font-size: 1rem;
        padding: 1rem 1.5rem;
    }
}

/* Extra small devices (phones portrait) */
@media (max-width: 380px) {
    .mac-container {
        margin: 0.8rem auto;      /* center horizontally */
        padding: 1rem 1rem;
        width: 100%;              /* make it wider */
        max-width: 100%;
    }

    .mac-field label {
        font-size: 0.85rem;
    }

    .mac-field input[type="number"],
    .mac-field input[type="text"] {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }

    .mac-button {
    font-size: 1.1rem;
    padding: 1rem 1.6rem;
    max-width: 100%;
    background-color: #a7151d;
    color: #fff;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(167, 21, 29, 0.8);
    transition: 
        background-color 0.3s ease, 
        box-shadow 0.3s ease, 
        transform 0.2s ease;
}

.mac-button:hover,
.mac-button:focus {
    background-color: #7e1014;
    box-shadow: 0 6px 20px rgba(126, 16, 20, 0.9);
    outline: none;
    transform: scale(1.05);
}

    .mac-results {
        font-size: 0.95rem;
        padding: 0.9rem 1.2rem;
        background-color: #fff !important; /* white background */
        color: #000 !important;            /* black text */
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }

    /* Assuming heading inside .mac-results uses h3 or similar */
    .mac-results h3 {
        color: #fff !important;            /* white upper text */
    }
}
