/* Reset and Box Sizing */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
}

/* Body */
body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}


/* Container */
.container {
    width: 100%;
    max-width: 1340px;
    padding: 10px;
    padding-top: 50px;
    margin-right: auto;
    margin-left: auto;
}


/* Content */
.content {
    display: flex;
    flex-wrap: wrap;
}

.inputsection {
    flex: 0 0 66.66667%;
    max-width: 66.66667%;
    border: 1px solid rgb(222, 226, 230);
    padding: 15px;
    border-radius: 0.25rem;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}


/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 3rem;
    background-color: #ebedf0;
    position: relative;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.brand-subtitle {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.navbar>a {
    color: #000;
    text-decoration: none;
    padding-left: 15px;
    display: flex;
}

.nav-link>div {
    font-size: 22px;
    font-weight: 600;
}

/* Form Styles */
#qrForm {
    padding: 15px;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

.form-check {
    display: flex;
    align-items: center;
}

input[type="checkbox"] {
    margin-right: 0.5rem;
    display: flex;
    justify-content: center;
}

.form-submit {
    display: flex;
    justify-content: center;
    margin-top: 35px;
}

#url-input {
    margin-top: 10px;
    margin-bottom: 10px;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    font-weight: 400;
    font-size: 20px;
    color: #fff;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    padding: 10px 20px;
    border-radius: 0.25rem;
    background-color: #007bff;
}

.btn:hover {
    background-color: #0056b3;
}

#download-links-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

#download-links-container .btn {
    width: 100%;
    justify-content: center;
    transition: all 0.3s ease;
}

#download-links-container .btn:disabled,
#download-links-container .btn.disabled {
    opacity: 0.65;
    pointer-events: none;
    cursor: not-allowed;
}

/* Responsive for download buttons */
@media (min-width: 768px) {
    #download-links-container {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    #download-links-container .btn {
        flex: 1 1 auto;
        min-width: 0;
        max-width: calc(33.333% - 6px);
        margin: 0;
        font-size: 14px;
        padding: 8px 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

#download-link {
    width: 100%;
    justify-content: center;
}

#download-link>div {
    font-weight: 400;
    font-size: 20px;
    /* padding: 7px 10px; */
}

.disabled {
    opacity: 0.65;
    pointer-events: none;
}

/* Output Section */
.outputsection {
    flex: 0 0 33.33333%;
    max-width: 33.33333%;
    border: 1px solid rgb(222, 226, 230);
    border-left: none;
    border-radius: 0.25rem;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.shortlinkcontainer {
    margin-top: 15px;
    text-align: center;
    word-break: break-all;
}

h3 {
    padding: 20px;
    text-align: center;
    font-size: 25px;
}

#qrImage {
    min-height: 250px;
    /*Sesuai ukuran Qr-code  */
    max-width: 100%;
    height: auto;
    width: 250px;
    opacity: 1;
}

/* Flex Utility Classes */
.outputsection>div {
    display: flex;
    justify-content: center;
    padding: 30px;
}

#short-link-container {
    text-align: center;
    min-height: 58.4px;
}

.link-container {
    height: auto;
    flex-direction: column;
    margin-bottom: 30px;
}

/* Main content area */
section {
    flex: 1;
}

/* Footer */
footer {
    background-color: #ebedf0;
    text-align: center;
    width: 100%;
    margin-top: auto;
}

footer div {
    padding: 1rem;
}

.text-body {
    text-decoration: none;
    color: black;
}



/* for Responsive */

/* Laptop View */
@media (max-width: 992px) {
    .inputsection {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .outputsection {
        flex: 0 0 100%;
        max-width: 100%;
        margin-top: 20px;
    }
}

/* Mobile View */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .navbar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .navbar>img {
        margin-bottom: 10px;
    }
    
    .navbar-right {
        width: 100%;
        justify-content: center;
    }

    .content {
        flex-direction: column;
        gap: 20px;
    }

    .inputsection,
    .outputsection {
        max-width: 100%;
        flex: 0 0 100%;
        width: 100%;
    }

    h3 {
        font-size: 20px;
    }

    #qrImage {
        width: 200px;
        max-width: 280px;
    }
    
    #qr-output-container {
        margin: 0 auto;
    }
    
    #empty-state, #qr-result {
        max-width: 280px;
        margin: 0 auto;
    }

    .btn {
        font-size: 18px;
        min-height: 44px; /* iOS touch target size */
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    input[type="color"] {
        width: 100%;
        height: 50px;
        border-radius: 8px;
    }
    
    .logo-options {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 8px;
        max-height: 200px;
        overflow-y: auto;
    }
    
    .logo-option img {
        width: 40px;
        height: 40px;
    }
    
    #download-links-container {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 15px;
    }
    
    #download-links-container .btn {
        width: 100%;
        max-width: none;
        margin: 0;
        text-align: center;
        padding: 12px;
        font-size: 16px;
    }
}

/* Small Mobile View */
@media (max-width: 576px) {
    #qrImage {
        width: 150px;
    }

    .btn {
        font-size: 16px;
        padding: 8px 15px;
    }
    
    #download-links-container .btn {
        font-size: 14px;
        padding: 8px 10px;
    }
}

/* Medium screens - tablet landscape */
@media (min-width: 768px) and (max-width: 1024px) {
    #download-links-container .btn {
        font-size: 13px;
        padding: 8px 10px;
        max-width: calc(33.333% - 5px);
    }
}


/* Container semua logo */
.logo-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}

.logo-option {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 60px;
    height: 60px;
    background-color: #fff;
    border: 2px solid #ccc;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    padding: 0 !important;
    margin: 0;
    box-sizing: border-box;
}

.logo-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.logo-option img {
    width: 32px !important;
    height: 32px !important;
    display: block !important;
    object-fit: contain;
    transition: transform 0.3s ease;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none;
    line-height: 0;
}

/* Efek hover pada kotak */
.logo-option:hover {
    border-color: #007BFF;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-4px);
}

/* Efek hover pada icon di dalam kotak */
.logo-option:hover img {
    transform: scale(1.2);
}

/* Efek ketika radio dipilih */
.logo-option input[type="radio"]:checked+img {
    transform: scale(1.2);
    filter: drop-shadow(0 0 4px #007BFF);
}

.logo-option:has(input[type="radio"]:checked) {
    border-color: #007BFF;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.7);
}

/* Tombol Pro di Navbar */
.btn-pro {
    margin-left: auto;
    /* dorong ke kanan */
    background-color: #28a745;
    /* hijau */
    color: #fff;
    padding: 8px 15px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.btn-pro:hover {
    background-color: #218838;
    /* hijau lebih gelap saat hover */
}

/* Tombol Pro di bawah Output Section */
.pro-link-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.btn-pro-secondary {
    background-color: #ffc107;
    /* kuning */
    color: #000;
    padding: 10px 20px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.btn-pro-secondary:hover {
    background-color: #e0a800;
    /* kuning lebih gelap saat hover */
}

/* Responsive untuk tombol Pro */
@media (max-width: 768px) {
    .btn-pro {
        margin-left: 0;
        margin-top: 10px;
    }

    .btn-pro-secondary {
        font-size: 16px;
        padding: 8px 15px;
    }
    
    /* Success notification for mobile */
    .success-notification {
        position: fixed !important;
        top: 10px !important;
        left: 10px !important;
        right: 10px !important;
        max-width: none !important;
        margin: 0 !important;
    }
}


/* Touch-friendly improvements */
.logo-option {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.logo-option:active {
    transform: scale(0.95);
    transition: transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
    transition: transform 0.1s;
}
