/* Office Supply Order Form - Frontend Styles */

.osof-order-form {
    max-width: 600px;
    margin: 20px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.osof-order-form h2 {
    margin-top: 0;
    color: #333;
    font-size: 24px;
    margin-bottom: 25px;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.osof-form-group {
    margin-bottom: 20px;
}

.osof-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.osof-search-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.osof-search-input {
    width: 100%;
    padding: 12px 45px 12px 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.osof-search-input:focus {
    outline: none;
    border-color: #0073aa;
}

.osof-clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.3s;
}

.osof-clear-btn:hover {
    background: #f0f0f0;
}

.osof-clear-btn.visible {
    display: flex;
}

.osof-clear-icon {
    width: 20px;
    height: 20px;
    color: #666;
}

.osof-dropdown {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.osof-dropdown:focus {
    outline: none;
    border-color: #0073aa;
}

.osof-dropdown option[style*="display: none"] {
    display: none;
}

.osof-dropdown option:disabled {
    display: none;
}

.osof-other-item-wrapper {
    display: none;
    margin-top: 10px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.osof-other-item-wrapper.active {
    display: block;
}

.osof-other-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.osof-other-input {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.osof-other-input:focus {
    outline: none;
    border-color: #0073aa;
}

.osof-add-item-btn {
    padding: 10px 20px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.osof-add-item-btn:hover {
    background: #005a87;
}

.osof-add-item-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.osof-tick-icon {
    width: 16px;
    height: 16px;
}

.osof-quantity-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.osof-quantity-input:focus {
    outline: none;
    border-color: #0073aa;
}

.osof-submit-btn {
    width: 100%;
    padding: 14px;
    background: #46b450;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
}

.osof-submit-btn:hover {
    background: #3a9d44;
}

.osof-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.osof-message {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: none;
}

.osof-message.active {
    display: block;
}

.osof-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.osof-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.osof-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: osof-spin 0.8s linear infinite;
}

@keyframes osof-spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .osof-order-form {
        padding: 20px;
        margin: 10px;
    }
    
    .osof-other-input-group {
        flex-direction: column;
    }
    
    .osof-add-item-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Order List with Code Protection */
.osof-order-list-wrapper {
    max-width: 900px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.osof-code-screen {
    display: none;
    min-height: 400px;
}

.osof-code-screen.active {
    display: block;
}

/* Code Entry Screen */
.osof-code-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 40px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.osof-code-container h2 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 24px;
}

.osof-code-container p {
    color: #666;
    margin-bottom: 30px;
}

.osof-code-inputs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.osof-code-digit {
    width: 60px;
    height: 70px;
    font-size: 32px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-weight: 600;
    transition: border-color 0.3s, transform 0.2s;
}

.osof-code-digit:focus {
    outline: none;
    border-color: #0073aa;
    transform: scale(1.05);
}

.osof-code-digit.error {
    border-color: #dc3232;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Order List Screen */
.osof-list-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.osof-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: #f9f9f9;
    border-bottom: 2px solid #0073aa;
}

.osof-list-header h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

.osof-logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #dc3232;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
}

.osof-logout-btn:hover {
    background: #c62828;
}

.osof-logout-icon {
    width: 18px;
    height: 18px;
}

.osof-orders-wrapper {
    padding: 30px;
    max-height: 600px;
    overflow-y: auto;
}

.osof-list-table {
    width: 100%;
    border-collapse: collapse;
}

.osof-list-table th {
    background: #f9f9f9;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
    position: sticky;
    top: 0;
}

.osof-list-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    color: #555;
}

.osof-list-table tbody tr:hover {
    background: #f9f9f9;
}

.osof-loading-cell {
    text-align: center;
    padding: 40px !important;
    color: #666;
}

.osof-no-orders {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

.osof-list-footer {
    padding: 20px 30px;
    background: #f9f9f9;
    border-top: 1px solid #ddd;
    text-align: center;
}

.osof-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
}

.osof-refresh-btn:hover {
    background: #005a87;
}

.osof-refresh-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.osof-refresh-icon {
    width: 18px;
    height: 18px;
}

.osof-refresh-btn.spinning .osof-refresh-icon {
    animation: osof-spin 1s linear infinite;
}

/* Responsive for order list */
@media (max-width: 768px) {
    .osof-order-list-wrapper {
        margin: 10px;
    }
    
    .osof-code-container {
        padding: 30px 20px;
    }
    
    .osof-code-inputs {
        gap: 10px;
    }
    
    .osof-code-digit {
        width: 50px;
        height: 60px;
        font-size: 28px;
    }
    
    .osof-list-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .osof-logout-btn {
        width: 100%;
        justify-content: center;
    }
    
    .osof-orders-wrapper {
        padding: 20px;
        overflow-x: auto;
    }
    
    .osof-list-table {
        font-size: 14px;
    }
    
    .osof-list-table th,
    .osof-list-table td {
        padding: 10px;
    }
}
