/*
==========================================================
INKRAH Web Design
General Calculator 50 Digits
Premium Utility Stylesheet
Version 1.1
==========================================================
*/

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

html{
    scroll-behavior:smooth;
}

body{
    font-family:
        "Segoe UI",
        Arial,
        Helvetica,
        sans-serif;
    background:#f4f6fb;
    color:#222;
    line-height:1.7;
}

.container{
    width:min(1100px,92%);
    margin:auto;
}

a{
    text-decoration:none;
}

/*
==========================================================
HEADER
==========================================================
*/

header{
    background:
    linear-gradient(
        135deg,
        #06162d,
        #0B2545,
        #13315C
    );
    position:sticky;
    top:0;
    z-index:1000;
    box-shadow:
    0 5px 20px
    rgba(0,0,0,.25);
}

header .container{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:18px 0;
}

.logo{
    display:flex;
    align-items:center;
    gap:14px;
    color:white;
}

.logo img{
    width:55px;
    height:55px;
    object-fit:contain;
}

.logo span{
    color:white;
    font-size:26px;
    font-weight:700;
}

nav{
    display:flex;
    gap:28px;
}

nav a{
    position:relative;
    color:white;
    font-weight:500;
}

nav a::after{
    content:"";
    position:absolute;
    bottom:-8px;
    left:0;
    width:0;
    height:2px;
    background:#d4af37;
    transition:.3s;
}

nav a:hover{
    color:#d4af37;
}

nav a:hover::after{
    width:100%;
}

/*
==========================================================
HERO & CALCULATOR CONTAINER
==========================================================
*/

.hero{
    background:
    linear-gradient(
        135deg,
        #0B2545,
        #1e4d8d
    );
    color:white;
    padding:60px 0;
}

.hero-intro {
    text-align: center;
    margin-bottom: 35px;
}

.hero h1{
    font-size:42px;
    margin-bottom:15px;
}

.hero p{
    max-width:850px;
    margin: 0 auto;
    opacity:.95;
}

/* Card Wrapper - Desktop Scaling */
.calc-card {
    max-width: 720px;
    margin: 0 auto;
    background: white;
    padding: 35px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    color: #222;
}

label{
    display:block;
    margin-top:18px;
    margin-bottom:8px;
    font-weight:600;
    color:#0B2545;
}

input,
select{
    width:100%;
    padding:14px;
    border: 1px solid #cfd8e3;
    border-radius:8px;
    font-size:16px;
}

input:focus,
select:focus{
    outline:none;
    border-color:#0B2545;
}

/* Calculator Displays */
.calc-screen {
    font-family: 'Consolas', 'Courier New', Courier, monospace;
    font-weight: 700;
    text-align: right;
    letter-spacing: 1px;
}

.secondary-screen {
    background: #f1f5f9;
    color: #64748b;
    font-size: 16px;
    padding: 12px 16px;
}

.primary-screen {
    background: #ffffff;
    color: #0B2545;
    font-size: 26px;
    padding: 18px 20px;
    border: 2px solid #cbd5e1;
}

/* Grid Layout for Keypad Buttons */
.calculator-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 25px;
}

button{
    margin-top:0;
    background:#d4af37;
    color:#0B2545;
    border:none;
    padding:18px;
    border-radius:10px;
    cursor:pointer;
    font-weight:700;
    font-size:20px;
    transition: all .2s ease-in-out;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
}

button:hover{
    background:#f0c84b;
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

.btn-util {
    background: #e2e8f0;
    color: #0B2545;
}

.btn-util:hover {
    background: #cbd5e1;
}

.btn-op {
    background: #0B2545;
    color: #ffffff;
}

.btn-op:hover {
    background: #13315C;
    color: #d4af37;
}

.btn-num {
    background: #f8fafc;
    color: #0B2545;
    border: 1px solid #e2e8f0;
}

.btn-num:hover {
    background: #edf2f7;
}

.btn-equals {
    grid-column: span 4;
    background: #d4af37;
    color: #0B2545;
    font-size: 24px;
    padding: 18px;
}

/*
==========================================================
MESSAGE & RESULT SUMMARY
==========================================================
*/

.error{
    margin-top:25px;
    background:#ffe9e9;
    color:#a30000;
    border-left: 5px solid red;
    padding:18px;
    border-radius:8px;
}

.result{
    margin-top:35px;
    background:#f8fafc;
    padding:28px;
    border-radius:12px;
    border: 1px solid #e2e8f0;
    color: #222;
}

.result h2{
    color:#0B2545;
    margin-bottom:20px;
    font-size: 22px;
}

.summary{
    width:100%;
    border-collapse:collapse;
}

.summary th{
    width:240px;
    background:#0B2545;
    color:white;
    text-align:left;
    padding:14px;
    border:1px solid #d8dee8;
}

.summary td{
    padding:14px;
    border:1px solid #d8dee8;
    background:white;
}

.summary tr:nth-child(even) td{
    background:#f7f9fc;
}

.break-all {
    word-break: break-all;
    font-family: 'Consolas', 'Courier New', Courier, monospace;
    font-weight: 600;
}

.result-container {
    display: none;
}

.result-container.show {
    display: block;
}

.action-buttons {
    display: flex;
    gap: 15px;
}

.action-buttons button {
    flex: 1;
}

/*
==========================================================
ABOUT & FAQ
==========================================================
*/

.about{
    background:white;
    padding:70px 0;
}

.about h2,
.faq h2{
    color:#0B2545;
    margin-bottom:20px;
}

.about p,
.faq p{
    text-align:justify;
}

.faq{
    background:#f7f9fc;
    padding:70px 0;
}

.faq h3{
    color:#173d73;
    margin-top:25px;
}

/*
==========================================================
FOOTER & UTILITIES
==========================================================
*/

footer{
    position:relative;
    background:
    linear-gradient(
        135deg,
        #06162d,
        #0B2545
    );
    color:white;
    padding:55px 0 35px;
    text-align:center;
}

footer::before{
    content:"";
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:3px;
    background:
    linear-gradient(
        90deg,
        #d4af37,
        white,
        #d4af37
    );
}

footer p{
    margin:10px 0;
}

footer a{
    color:#d4af37;
}

footer a:hover{
    color:white;
}

.mt-30{
    margin-top:30px;
}

#backTop{
    display:none;
    position:fixed;
    right:20px;
    bottom:20px;
    width:45px;
    height:45px;
    border-radius:50%;
    background:#0B2545;
    color:white;
    z-index:999;
}

/*
==========================================================
RESPONSIVE MEDIA QUERIES
==========================================================
*/

/* PC & Large Screens Scaling */
@media(min-width: 1024px) {
    .calc-card {
        max-width: 780px;
        padding: 45px;
    }
    
    .primary-screen {
        font-size: 30px;
    }
    
    button {
        padding: 22px;
        font-size: 22px;
    }
}

/* Mobile & Tablet Layout Adjustments */
@media(max-width:768px){
    header .container{
        flex-direction:column;
        gap:15px;
    }

    .logo span{
        font-size:22px;
    }

    nav{
        flex-wrap:wrap;
        justify-content:center;
    }

    .hero h1{
        font-size:30px;
    }

    .calc-card {
        padding: 20px;
        border-radius: 12px;
    }

    .primary-screen {
        font-size: 20px;
        padding: 12px;
    }

    .calculator-grid {
        gap: 8px;
    }

    button {
        padding: 14px;
        font-size: 16px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .summary,
    .summary tbody,
    .summary tr,
    .summary th,
    .summary td{
        display:block;
        width:100%;
    }

    .summary tr{
        margin-bottom:18px;
    }
}

@media print{
    header,
    footer,
    nav,
    button{
        display:none;
    }

    body{
        background:white;
    }

    .result{
        box-shadow:none;
        border:1px solid #ccc;
        position:relative;
        z-index:50;
    }

    #resultContainer{
        display:block !important;
        visibility:visible !important;
        opacity:1 !important;
    }

    .hero{
        overflow:visible !important;
    }
}


/*
==========================================================
FAQ RESPONSIVE SQUARE IMAGE
==========================================================
*/

.faq-image-section {
    background: #f7f9fc; /* Menyatu dengan latar belakang bagian FAQ */
    padding: 0 0 60px 0; /* Jarak bawah ke footer */
    text-align: center;
}

.faq-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.responsive-square-img {
    /* Lebar adaptif tetapi dibatasi maksimal 360px di layar PC */
    width: 100%;
    max-width: 360px;
    
    /* Mengunci rasio persegi (1:1) dan menjaga kualitas gambar */
    aspect-ratio: 1 / 1;
    object-fit: cover;
    
    /* Styling elegan khas INKRAH */
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(11, 37, 69, 0.1);
    border: 1px solid #e2e8f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.responsive-square-img:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(11, 37, 69, 0.15);
}

/* Penyesuaian Responsif Khusus HP / Tablet */
@media (max-width: 768px) {
    .faq-image-section {
        padding: 0 0 40px 0;
    }

    .responsive-square-img {
        /* Di layar HP dibatasi maksimal 260px agar tidak memenuhi seluruh layar */
        max-width: 260px;
        border-radius: 12px;
    }
}