/*
 * Riso Calculator styles.css
 * Theme Name: Riso Calculator
 * Description: Styles for the Riso Calculator plugin, inspired by qzhop.com with Lazada-like design.
 */

/* --------------------------------------------------
 * RESET & BASE STYLES
 * -------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

/* --------------------------------------------------
 * TYPOGRAPHY
 * -------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: #222;
    margin-bottom: 15px;
}

h1 { font-size: 36px; }
h2 { font-size: 32px; }
h3 { font-size: 28px; }

p {
    margin-bottom: 12px;
}

a {
    color: #f57224;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #d65e1e;
}

/* --------------------------------------------------
 * LAYOUT - CONTENT WRAPPER
 * -------------------------------------------------- */
#content,
#primary.content-area {
    max-width: 1500px;
    margin: 0 auto;
    padding: 20px 0;
    float: none !important;
}

#content .container,
#content .container-fluid,
#primary.content-area .container,
#primary.content-area .container-fluid {
    max-width: 1500px;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
    float: none !important;
}

/* --------------------------------------------------
 * HEADER & NAVIGATION
 * -------------------------------------------------- */
.header-menu,
#site-navigation {
    max-width: none;
    width: 100%;
    background-color: #fff;
    border-bottom: 1px solid #e8e8e8;
    position: sticky;
    top: 0;
    z-index: 1000;
}

#site-navigation .container {
    max-width: 1500px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
}

#site-navigation .search-form {
    flex-grow: 1;
    max-width: 600px;
    margin: 0 20px;
}

#site-navigation .search-form input[type="search"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background-color: #fff;
}

#site-navigation .search-form button {
    background-color: #f57224;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 14px;
}

#site-navigation .search-form button:hover {
    background-color: #d65e1e;
}

/* --------------------------------------------------
 * FOOTER
 * -------------------------------------------------- */
.footer-area {
    max-width: none;
    width: 100%;
    background-color: #f5f5f5;
    padding: 40px 0;
    color: #666;
}

.footer-area .container {
    max-width: 1500px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.footer-area h4 {
    font-size: 20px;
    color: #333;
    margin-bottom: 12px;
}

.footer-area ul {
    list-style: none;
}

.footer-area ul li {
    margin-bottom: 12px;
}

.footer-area ul li a {
    color: #666;
    font-size: 16px;
}

.footer-area ul li a:hover {
    color: #f57224;
}

/* --------------------------------------------------
 * BUTTONS
 * -------------------------------------------------- */
button,
.button,
input[type="submit"],
.riso-calculator-button,
.riso-calculator-action-button,
.submit-button,
.add-to-cart-btn {
    background-color: #f57224;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin: 5px;
}

button:hover,
.button:hover,
input[type="submit"]:hover,
.riso-calculator-button:hover,
.riso-calculator-action-button:hover,
.submit-button:hover,
.add-to-cart-btn:hover {
    background-color: #d65e1e;
}

#add-new-item {
    background-color: #28a745;
}

#add-new-item:hover {
    background-color: #218838;
}

.riso-cancel-btn,
.riso-delete-selected-btn {
    background-color: #dc3545;
    padding: 10px 16px;
    font-size: 14px;
}

.riso-cancel-btn:hover,
.riso-delete-selected-btn:hover {
    background-color: #c82333;
}

.riso-delete-selected-btn:disabled,
.add-to-cart-btn:disabled {
    background-color: #d1d5db;
    cursor: not-allowed;
    opacity: 0.5;
}

/* --------------------------------------------------
 * RISO CALCULATOR MAIN PAGE
 * -------------------------------------------------- */
.riso-calculator-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 18px;
    color: #1a1a1a;
    margin-bottom: 50px;
}

/* --------------------------------------------------
 * CALCULATOR FORM
 * -------------------------------------------------- */
.riso-calculator-form,
.riso-custom-form {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.riso-calculator-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #0d0d0d;
    font-size: 16px;
}

.riso-calculator-input,
.riso-calculator-select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ccc;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 16px;
    color: #111;
    background-color: #fff;
    transition: border-color 0.3s ease;
}

.riso-calculator-input:focus,
.riso-calculator-select:focus {
    border-color: #4a90e2;
    outline: none;
}

.riso-calculator-input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    accent-color: #4a90e2;
    transform: scale(1.3);
}

/* --------------------------------------------------
 * CART CONTENTS
 * -------------------------------------------------- */
#cart-contents {
    max-width: 100%;
    margin: 20px auto;
    padding: 20px;
    padding-top: 60px; /* Space for sticky header */
    background: #ffffff;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.riso-table-scrollable {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#cart-contents table {
    width: 100%;
    min-width: 500px;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 20px;
}

#cart-contents th,
#cart-contents td {
    padding: 6px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

#cart-contents th {
    text-align: left;
    font-weight: 600;
    background: #f9f9f9;
}

#cart-contents td:nth-child(5),
#cart-contents th:nth-child(5),
#cart-contents td:nth-child(6),
#cart-contents th:nth-child(6) {
    text-align: right;
    min-width: 80px;
}

#cart-contents td:nth-child(4) {
    min-width: 250px;
    white-space: normal;
}

#cart-contents tr[style*="border-top:2px solid #ddd"] td {
    font-weight: bold;
}

#cart-contents .riso-title-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.riso-title {
    font-weight: bold;
}

.riso-file-actions,
.riso-attach-file-form {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: auto;
}

.riso-file-label,
.riso-attach-file-btn {
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 10px;
    line-height: 1.4;
    cursor: pointer;
}

.riso-file-label {
    background: #6b7280;
    color: #fff;
}

.riso-attach-file-btn {
    background: #4a90e2;
    color: #fff;
    border: none;
}

.riso-attach-file-btn:disabled {
    background: #d1d5db;
    color: #6b7280;
    cursor: not-allowed;
}

.riso-description-details {
    margin-top: 6px;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* --------------------------------------------------
 * RESULT SECTION
 * -------------------------------------------------- */
#result {
    max-width: 100%;
    margin: 20px auto;
    padding: 20px;
    padding-top: 60px; /* Space for sticky header */
    background: #e8f5e9;
    color: #1b5e20;
    border: 2px solid #c8e6c9;
    border-radius: 8px;
    font-size: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

#result h3 {
    font-size: 24px;
    color: #1b5e20;
    margin-bottom: 15px;
    text-align: center;
}

#result p {
    margin: 8px 0;
}

#result .add-to-cart-btn {
    background-color: #28a745;
    color: #fff;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    margin-top: 12px;
    width: 100%;
}

#result .add-to-cart-btn:hover {
    background-color: #218838;
}

/* --------------------------------------------------
 * MESSAGES
 * -------------------------------------------------- */
.riso-message-container {
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 18px;
    text-align: center;
    margin-bottom: 20px;
}

.riso-message-container[style*="color: green"] {
    background: #d4edda;
    border: 2px solid #28a745;
    color: #155724;
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.riso-message-container[style*="color: red"] {
    background: #f8d7da;
    border: 2px solid #dc3545;
    color: #721c24;
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* --------------------------------------------------
 * SCROLL ARROWS
 * -------------------------------------------------- */
.riso-scroll-arrow {
    position: absolute;
    top: -20px;
    background-color: #4a90e2;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s ease;
    background-size: 16px;
    background-repeat: no-repeat;
    background-position: center;
    display: none;
}

.riso-scroll-arrow:hover {
    background-color: #357ab8;
}

.riso-scroll-left {
    left: 0;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTAgMTJMNCA4TDQgNCIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==');
}

.riso-scroll-right {
    right: 0;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNiAxMkwxMCA4TDYgNCIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==');
}

/* --------------------------------------------------
 * CHECKBOX STYLES
 * -------------------------------------------------- */
.riso-cart-checkbox,
#select-all-cart-items {
    accent-color: #4a90e2;
    transform: scale(1.3);
    margin: 0 6px;
}

/* --------------------------------------------------
 * COMMENTS
 * -------------------------------------------------- */
#comments {
    max-width: 800px !important;
    margin: 0 auto;
    padding: 24px 16px;
}

/* --------------------------------------------------
 * RESPONSIVE DESIGN
 * -------------------------------------------------- */
@media (max-width: 768px) {
    #content,
    #primary.content-area {
        padding: 10px 0;
    }

    #content .container,
    #content .container-fluid,
    #primary.content-area .container,
    #primary.content-area .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }

    h1 { font-size: 32px; }
    h2 { font-size: 28px; }
    h3 { font-size: 24px; }

    #site-navigation .container {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    #site-navigation .search-form {
        margin: 10px 0;
        max-width: 100%;
    }

    .riso-calculator-page,
    .riso-calculator-form,
    .riso-custom-form,
    #result,
    #cart-contents {
        padding: 15px;
        padding-top: 50px;
    }

    .riso-calculator-button,
    .submit-button,
    .riso-calculator-action-button {
        width: 100%;
        padding: 8px 12px;
        font-size: 12px;
    }

    .riso-cancel-btn,
    .riso-delete-selected-btn {
        width: 100%;
        padding: 8px 12px;
        font-size: 12px;
    }

    #cart-contents td:nth-child(4) {
        min-width: 200px;
    }

    .riso-file-actions,
    .riso-attach-file-form {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .riso-file-label,
    .riso-attach-file-btn {
        width: 100%;
        text-align: center;
        padding: 3px 6px;
        font-size: 10px;
    }

    .riso-table-scrollable {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: #4a90e2 #e8e8e8;
    }

    .riso-table-scrollable::-webkit-scrollbar {
        height: 8px;
    }

    .riso-table-scrollable::-webkit-scrollbar-track {
        background: #e8e8e8;
        border-radius: 4px;
    }

    .riso-table-scrollable::-webkit-scrollbar-thumb {
        background: #4a90e2;
        border-radius: 4px;
    }

    .riso-scroll-arrow {
        width: 20px;
        height: 20px;
        background-size: 14px;
    }
}

@media (max-width: 576px) {
    .footer-area .container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 412px) {
    .riso-calculator-page {
        padding: 0 5px;
    }

    .riso-calculator-form,
    .riso-custom-form {
        padding: 10px;
        border-radius: 6px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    }

    .riso-calculator-label {
        font-size: 14px;
        margin-bottom: 5px;
    }

    .riso-calculator-input,
    .riso-calculator-select {
        font-size: 14px;
        padding: 8px;
        margin-bottom: 10px;
        border-width: 1px;
    }

    .riso-calculator-input[type="checkbox"] {
        transform: scale(1.2);
        margin-right: 8px;
    }

    .riso-calculator-button,
    .submit-button {
        padding: 8px 12px;
        font-size: 12px;
    }

    .riso-cancel-btn,
    .riso-delete-selected-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    .riso-file-label,
    .riso-attach-file-btn {
        padding: 2px 5px;
        font-size: 9px;
    }

    #result,
    #cart-contents {
        padding: 10px;
        padding-top: 40px;
        font-size: 14px;
    }

    #cart-contents table,
    #result table {
        font-size: 12px;
        min-width: 500px;
    }

    #cart-contents td:nth-child(4) {
        min-width: 150px;
    }

    .riso-description-details {
        font-size: 11px;
    }

    .riso-table-scrollable {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: #4a90e2 #e8e8e8;
    }

    .riso-table-scrollable::-webkit-scrollbar {
        height: 6px;
    }

    .riso-table-scrollable::-webkit-scrollbar-track {
        background: #e8e8e8;
        border-radius: 4px;
    }

    .riso-table-scrollable::-webkit-scrollbar-thumb {
        background: #4a90e2;
        border-radius: 4px;
    }

    .riso-scroll-arrow {
        width: 18px;
        height: 18px;
        background-size: 12px;
    }
}

.riso-calculator-cart-details {
    display: block !important;
    font-size: 12px !important;
    color: #666 !important;
    margin-top: 6px;
    line-height: 1.4;
}