/* Brochure Download Plugin Styles */

.brochure-btn {
    background-color: #007cba;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.brochure-btn:hover {
    background-color: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

/* Sticky Positioning Styles */
.brochure-container.sticky-left {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
}

.brochure-container.sticky-right {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
}

.brochure-container.sticky-top {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.brochure-container.sticky-bottom {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

/* Responsive adjustments for sticky positioning */
@media (max-width: 768px) {
    .brochure-container.sticky-left {
        left: 10px;
    }
    
    .brochure-container.sticky-right {
        right: 10px;
    }
    
    .brochure-container.sticky-top {
        top: 10px;
    }
    
    .brochure-container.sticky-bottom {
        bottom: 10px;
    }
}

.brochure-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
}

.popup-content {
    position: relative;
    background: white;
    width: 90%;
    max-width: 500px;
    padding: 50px 30px 30px 30px; /* More top padding for close button */
    margin: 20px 0; /* Add margin for better spacing */
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.3s ease-out;
    max-height: 90vh; /* Limit height for mobile */
    overflow-y: auto; /* Allow scrolling if needed */
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 15px;
    width: 35px;
    height: 35px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
    line-height: 35px;
    text-align: center;
    font-weight: bold;
    border-radius: 50%;
    background: #f5f5f5;
    border: 1px solid #ddd;
    z-index: 10001; /* Ensure it's above other elements */
}

.close-popup:hover {
    color: #fff;
    background: #dc3545;
    border-color: #dc3545;
    transform: scale(1.1);
}

.popup-content h3 {
    margin-top: 10px; /* Add some top margin */
    margin-bottom: 30px;
    color: #333;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    padding-right: 40px; /* Make room for close button */
}

.form-group {
    margin-bottom: 25px;
}

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

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

.form-group input:focus {
    outline: none;
    border-color: #007cba;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.form-group input:valid {
    border-color: #28a745;
}

.submit-btn {
    width: 100%;
    background: linear-gradient(45deg, #007cba, #0096d6);
    color: white;
    padding: 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.submit-btn:hover {
    background: linear-gradient(45deg, #005a87, #007cba);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 124, 186, 0.4);
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#form-message {
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
    text-align: center;
    font-weight: 600;
    animation: slideIn 0.3s ease-out;
}

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

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .popup-content {
        width: 95%;
        padding: 30px 20px;
        margin: 20px;
    }
    
    .popup-content h3 {
        font-size: 20px;
        margin-bottom: 25px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .brochure-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Loading animation for submit button */
.submit-btn.loading {
    position: relative;
    color: transparent;
}

.submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

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

/* Multiple Brochures Styles */
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

.form-group select:focus {
    outline: none;
    border-color: #007cba;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.brochure-description {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-left: 4px solid #007cba;
    border-radius: 0 4px 4px 0;
    font-size: 13px;
    color: #666;
    display: none;
}

.brochure-description p {
    margin: 0;
}

/* Category badges for admin */
.category-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-general { background: #e3f2fd; color: #1565c0; }
.category-products { background: #e8f5e8; color: #2e7d32; }
.category-services { background: #fff3e0; color: #ef6c00; }
.category-catalogs { background: #f3e5f5; color: #7b1fa2; }
.category-brochures { background: #fce4ec; color: #c2185b; }
.category-other { background: #f5f5f5; color: #666; }

/* File link styling */
.file-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: #007cba;
    font-weight: 500;
}

.file-link:hover {
    text-decoration: underline;
}

.file-link .dashicons {
    font-size: 16px;
}

.file-error {
    color: #d63638;
    font-style: italic;
}

/* Mobile responsive styles for popup */
@media (max-width: 768px) {
    .popup-content {
        width: 95%;
        margin: 10px 5px;
        padding: 40px 20px 25px 20px;
        max-height: 95vh;
    }
    
    .close-popup {
        top: 8px;
        right: 12px;
        width: 30px;
        height: 30px;
        font-size: 20px;
        line-height: 30px;
    }
    
    .popup-content h3 {
        font-size: 20px;
        margin-bottom: 25px;
        padding-right: 35px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-group input {
        padding: 10px 12px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

@media (max-width: 480px) {
    .popup-content {
        width: 98%;
        margin: 5px 1%;
        padding: 35px 15px 20px 15px;
    }
    
    .popup-content h3 {
        font-size: 18px;
        margin-bottom: 20px;
    }
    
    .form-group input {
        padding: 12px 10px;
    }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state .dashicons {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 15px;
}