/**
 * Bundle WP Notifications - Frontend Styles
 *
 * Frontend CSS styles for popup notifications, header bars, and forms
 *
 * @package BundleWP\Notifications
 * @since 1.0.0
 */

/* Reset and base styles */
.bundle-wp-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: none;
    animation: bundleWpFadeIn 0.3s ease-out;
}

.bundle-wp-popup-content {
    position: absolute;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    animation: bundleWpSlideIn 0.3s ease-out;
}

/* Popup positioning */
.bundle-wp-popup-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.bundle-wp-popup-top {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.bundle-wp-popup-bottom {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.bundle-wp-popup-left {
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
}

.bundle-wp-popup-right {
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
}

/* Popup close button */
.bundle-wp-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    z-index: 1000001;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.bundle-wp-popup-close:hover {
    background-color: #f0f0f0;
    color: #333;
}

/* Header bar styles */
.bundle-wp-header-bar {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #007cba;
    color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: bundleWpSlideDown 0.3s ease-out;
}

.bundle-wp-header-top {
    top: 0;
}

.bundle-wp-header-bottom {
    bottom: 0;
}

.bundle-wp-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.bundle-wp-header-text {
    flex: 1;
    font-size: 16px;
    line-height: 1.4;
}

.bundle-wp-header-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    margin-left: 15px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.bundle-wp-header-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Form styles */
.bundle-wp-form-container {
    padding: 30px;
    text-align: center;
}

.bundle-wp-form-group {
    margin-bottom: 20px;
    text-align: left;
}

.bundle-wp-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.bundle-wp-form-group input,
.bundle-wp-form-group textarea,
.bundle-wp-form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e1e1;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.bundle-wp-form-group input:focus,
.bundle-wp-form-group textarea:focus,
.bundle-wp-form-group select:focus {
    outline: none;
    border-color: #007cba;
}

.bundle-wp-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.bundle-wp-submit-btn {
    background: #007cba;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    width: 100%;
}

.bundle-wp-submit-btn:hover {
    background: #005a87;
}

.bundle-wp-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Form messages */
.bundle-wp-form-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    font-weight: 500;
}

.bundle-wp-form-message.bundle-wp-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.bundle-wp-form-message.bundle-wp-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Animations */
@keyframes bundleWpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bundleWpSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes bundleWpSlideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

@keyframes bundleWpSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Responsive design */
@media (max-width: 768px) {
    .bundle-wp-popup-content {
        max-width: 95%;
        margin: 20px;
    }

    .bundle-wp-form-container {
        padding: 20px;
    }

    .bundle-wp-header-content {
        padding: 12px 15px;
        flex-direction: column;
        align-items: flex-start;
    }

    .bundle-wp-header-text {
        margin-bottom: 10px;
    }

    .bundle-wp-header-close {
        margin-left: 0;
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .bundle-wp-popup-content {
        max-width: 98%;
        margin: 10px;
    }

    .bundle-wp-form-container {
        padding: 15px;
    }

    .bundle-wp-form-group input,
    .bundle-wp-form-group textarea,
    .bundle-wp-form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .bundle-wp-popup-close,
    .bundle-wp-header-close {
        width: 40px;
        height: 40px;
        font-size: 28px;
    }
}

/* Loading states */
.bundle-wp-loading {
    position: relative;
}

.bundle-wp-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: bundleWpSpin 1s linear infinite;
}

@keyframes bundleWpSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility improvements */
.bundle-wp-popup-overlay[aria-hidden="true"] {
    display: none !important;
}

.bundle-wp-popup-content:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bundle-wp-popup-overlay {
        background-color: rgba(0, 0, 0, 0.9);
    }

    .bundle-wp-popup-content {
        border: 2px solid #fff;
    }

    .bundle-wp-header-bar {
        border: 2px solid #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .bundle-wp-popup-overlay,
    .bundle-wp-popup-content,
    .bundle-wp-header-bar {
        animation: none;
    }
}

/* Print styles */
@media print {
    .bundle-wp-popup-overlay,
    .bundle-wp-header-bar {
        display: none !important;
    }
}

/* Admin bar compatibility */
.admin-bar .bundle-wp-header-top {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar .bundle-wp-header-top {
        top: 46px;
    }
}

/* RTL support */
.rtl .bundle-wp-header-content {
    direction: rtl;
}

.rtl .bundle-wp-header-close {
    margin-left: 0;
    margin-right: 15px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .bundle-wp-popup-content {
        background: #1e1e1e;
        color: #f0f0f0;
    }

    .bundle-wp-form-group label {
        color: #f0f0f0;
    }

    .bundle-wp-form-group input,
    .bundle-wp-form-group textarea,
    .bundle-wp-form-group select {
        background: #2d2d2d;
        border-color: #404040;
        color: #f0f0f0;
    }

    .bundle-wp-form-group input:focus,
    .bundle-wp-form-group textarea:focus,
    .bundle-wp-form-group select:focus {
        border-color: #007cba;
    }
}

/* Bundle WP footer branding - must be included as per requirements */
.bundle-wp-footer-branding {
    text-align: center;
    margin: 20px 0;
    padding: 10px;
    font-size: 12px;
    color: #666;
}

.bundle-wp-footer-branding a {
    color: #666;
    text-decoration: none;
    font-weight: 500;
}

.bundle-wp-footer-branding a:hover {
    color: #007cba;
    text-decoration: underline;
}

/* Utility classes */
.bundle-wp-hidden {
    display: none !important;
}

.bundle-wp-visible {
    display: block !important;
}

.bundle-wp-text-center {
    text-align: center;
}

.bundle-wp-text-left {
    text-align: left;
}

.bundle-wp-text-right {
    text-align: right;
}

/* Debug styles for development */
.bundle-wp-debug {
    border: 2px solid red !important;
    background: rgba(255, 0, 0, 0.1) !important;
}

.bundle-wp-debug::before {
    content: 'DEBUG: ';
    color: red;
    font-weight: bold;
}