/**
 * My WooCommerce Manager Styles
 */

/* Password form */
.mwm-password-form {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    direction: rtl;
    font-family: 'Heebo', sans-serif;
}

.mwm-password-form h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 24px;
}

.mwm-password-form input[type="password"] {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    direction: rtl;
}

.mwm-password-form input[type="submit"] {
    width: 100%;
    padding: 15px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.mwm-password-form input[type="submit"]:hover {
    background-color: #45a049;
}

.mwm-error {
    color: #f44336;
    margin-bottom: 15px;
    font-weight: bold;
}

/* Manager page */
.mwm-manager-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f5f8fa;
    border-radius: 16px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
    direction: rtl;
    font-family: 'Heebo', sans-serif;
}

.mwm-section {
    margin-bottom: 30px;
    background-color: #fff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.mwm-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.mwm-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.mwm-section-title {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

/* Notification messages */
.mwm-success-message {
    background-color: #4CAF50;
    color: white;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
}

.mwm-error-message {
    background-color: #f44336;
    color: white;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
}

/* Switch */
.mwm-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.mwm-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mwm-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.mwm-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .mwm-slider {
    background-color: #4CAF50;
}

input:focus + .mwm-slider {
    box-shadow: 0 0 1px #4CAF50;
}

input:checked + .mwm-slider:before {
    transform: translateX(26px);
}

.mwm-status-text {
    font-size: 18px;
    font-weight: bold;
    margin-right: 10px;
}

.mwm-status-open {
    color: #4CAF50;
}

.mwm-status-closed {
    color: #f44336;
}

/* Business hours */
.mwm-business-hours {
    width: 100%;
}

.mwm-day-row {
    display: flex;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #eee;
}

.mwm-day-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.mwm-day-name {
    width: 100px;
    font-weight: bold;
    font-size: 16px;
    display: flex;
    align-items: center;
}

.mwm-time-inputs {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.mwm-time-input {
    width: 120px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-right: 10px;
    text-align: center;
    transition: border-color 0.3s;
}

.mwm-time-input:focus {
    border-color: #4CAF50;
    outline: none;
}

.mwm-time-separator {
    margin: 0 15px;
    font-weight: bold;
    color: #666;
}

.mwm-update-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 15px;
    cursor: pointer;
    margin-right: 10px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.mwm-update-btn:hover {
    background-color: #45a049;
}

/* Closed dates */
.mwm-closed-dates {
    margin-top: 20px;
}

.mwm-date-picker {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.mwm-date-picker:focus {
    border-color: #4CAF50;
    outline: none;
}

.mwm-date-tag {
    display: inline-block;
    background-color: #f1f1f1;
    padding: 8px 16px;
    margin: 5px;
    border-radius: 20px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.mwm-date-tag:hover {
    background-color: #e0e0e0;
}

.mwm-date-tag-remove {
    background: none;
    border: none;
    color: #f44336;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    padding: 0;
    margin-right: 8px;
}

.mwm-add-date-btn {
    padding: 12px 18px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.mwm-add-date-btn:hover {
    background-color: #45a049;
}

/* Category headers */
.mwm-category-header {
    grid-column: 1 / -1;
    background-color: #f5f8fa;
    padding: 10px 15px;
    margin: 15px 0 10px 0;
    border-radius: 8px;
    border-right: 4px solid #4CAF50;
}

.mwm-category-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

/* Products */
.mwm-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.mwm-product-card {
    background-color: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.mwm-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.mwm-product-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.mwm-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    color: #999;
    font-size: 14px;
}

.mwm-product-details {
    padding: 18px;
}

.mwm-product-name {
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 15px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
}

.mwm-product-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Loading */
.mwm-loading {
    text-align: center;
    padding: 30px;
}

.mwm-loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4CAF50;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1.5s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Popups */
.mwm-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    direction: rtl;
    animation: fadeIn 0.3s ease-in-out;
}

.mwm-popup-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    animation: scaleIn 0.3s ease-in-out;
}

.mwm-popup-content h3 {
    margin: 0 0 15px 0;
    font-size: 22px;
    color: #333;
}

.mwm-popup-content p {
    margin: 0 0 20px 0;
    font-size: 16px;
    line-height: 1.5;
}

.mwm-popup-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.mwm-popup-btn:hover {
    background-color: #45a049;
}

/* Store closed overlay */
#mwm-store-closed-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    direction: rtl;
}

#mwm-store-closed-overlay h2 {
    color: white;
    margin: 0 0 15px 0;
    font-size: 28px;
    font-weight: bold;
}

#mwm-store-closed-overlay p {
    color: white;
    margin: 0 0 10px 0;
    font-size: 18px;
    line-height: 1.5;
}

@media (max-width: 768px) {
    #mwm-store-closed-overlay h2 {
        font-size: 22px !important;
        white-space: nowrap;
    }
    
    #mwm-store-closed-overlay p {
        font-size: 16px !important;
    }
}

/* Responsive */
@media screen and (max-width: 768px) {
    .mwm-day-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .mwm-day-name {
        margin-bottom: 15px;
    }
    
    .mwm-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .mwm-time-inputs {
        width: 100%;
    }
    
    .mwm-time-input {
        width: 45%;
    }
    
    .mwm-popup-content {
        width: 85%;
        padding: 20px;
    }
    
    .mwm-update-btn {
        margin-top: 10px;
    }
}

/* Additional responsive tweaks */
@media screen and (max-width: 480px) {
    .mwm-section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .mwm-store-status {
        margin-top: 15px;
    }
    
    .mwm-products-grid {
        grid-template-columns: 1fr;
    }
    
    .mwm-manager-container {
        padding: 10px;
    }
    
    .mwm-section {
        padding: 15px;
    }
    
    .mwm-popup-content {
        padding: 15px;
    }
}

/* Closure request button */
.mwm-closure-request-btn {
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s;
    display: inline-block;
}

.mwm-closure-request-btn:hover {
    background-color: #d32f2f;
}

/* Closure popup styles */
.mwm-closure-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
    min-height: 100px;
    margin-bottom: 20px;
    direction: rtl;
    font-family: 'Heebo', sans-serif;
}

.mwm-closure-textarea:focus {
    border-color: #f44336;
    outline: none;
}

.mwm-popup-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.mwm-popup-cancel {
    background-color: #ccc;
}

.mwm-popup-cancel:hover {
    background-color: #999;
}

.mwm-popup-submit {
    background-color: #f44336;
}

.mwm-popup-submit:hover {
    background-color: #d32f2f;
}

.mwm-popup-submit:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Animation classes for dynamic messages */
.mwm-fade-in {
    animation: fadeIn 0.5s ease-in;
}

.mwm-fade-out {
    animation: fadeOut 0.5s ease-out;
}

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

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}
/* Animation effects */
.mwm-section, .mwm-product-card {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Better focus states for accessibility */
.mwm-time-input:focus,
.mwm-date-picker:focus,
input[type="checkbox"]:focus + .mwm-slider,
.mwm-add-date-btn:focus,
.mwm-popup-btn:focus,
.mwm-update-btn:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* Custom scrollbar */
.mwm-manager-container::-webkit-scrollbar {
    width: 8px;
}

.mwm-manager-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.mwm-manager-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.mwm-manager-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}