/**
 * MemberPress Video Recorder Styles
 */

/* Modal Styles */
.mpvr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.mpvr-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.mpvr-modal-content {
    position: relative;
    background: #fff;
    margin: 50px auto;
    padding: 0;
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.mpvr-modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mpvr-modal-header h3 {
    margin: 0;
    font-size: 1.5em;
    color: #333;
}

/* Video Container Styles */
.mpvr-video-container {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.mpvr-camera-preview,
.mpvr-recorded-preview {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    display: block;
}

.mpvr-camera-preview.hidden,
.mpvr-recorded-preview.hidden {
    display: none;
}

.mpvr-video-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: #f5f5f5;
    color: #666;
    font-size: 16px;
    border-radius: 8px;
}

.mpvr-video-placeholder.hidden {
    display: none;
}

/* Status Message Styles */
.mpvr-status {
    padding: 10px 15px;
    border-radius: 4px;
    margin: 10px 0;
    font-weight: 500;
}

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

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

.mpvr-status.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Recording Timer */
.mpvr-timer {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-family: monospace;
    font-size: 14px;
    font-weight: bold;
}

.mpvr-timer.hidden {
    display: none;
}

/* Loading Animation */
.mpvr-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: mpvr-spin 1s linear infinite;
}

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

.mpvr-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mpvr-modal-close:hover {
    color: #000;
}

.mpvr-modal-body {
    padding: 20px;
}

/* Video Container */
.mpvr-video-container {
    position: relative;
    margin-bottom: 20px;
    text-align: center;
}

.mpvr-video-preview {
    width: 100%;
    max-width: 600px;
    height: auto;
    background: #000;
    border-radius: 4px;
}

.mpvr-recording-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mpvr-recording-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Button Styles */
.mpvr-btn {
    display: inline-block;
    padding: 10px 20px;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mpvr-btn-primary {
    background-color: #2271b1;
    color: white;
}

.mpvr-btn-primary:hover {
    background-color: #135e96;
}

.mpvr-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.mpvr-btn:active {
    transform: translateY(0);
}

.mpvr-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Video Grid Styles */
.mpvr-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.mpvr-video-item {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.mpvr-video-wrapper {
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
}

.mpvr-video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mpvr-video-info {
    padding: 15px;
}

.mpvr-video-info p {
    margin: 5px 0;
    font-size: 14px;
    color: #555;
}

.mpvr-video-info strong {
    color: #333;
}

@media (max-width: 768px) {
    .mpvr-videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}
    cursor: not-allowed;
    transform: none;
}

.mpvr-btn-primary {
    background: #0073aa;
    color: white;
}

.mpvr-btn-primary:hover {
    background: #005a87;
}

.mpvr-btn-success {
    background: #46b450;
    color: white;
}

.mpvr-btn-success:hover {
    background: #3a9940;
}

.mpvr-btn-danger {
    background: #dc3232;
    color: white;
}

.mpvr-btn-danger:hover {
    background: #b32d2e;
}

.mpvr-btn-secondary {
    background: #666;
    color: white;
}

.mpvr-btn-secondary:hover {
    background: #555;
}

/* Controls */
.mpvr-controls {
    text-align: center;
    margin: 20px 0;
}

/* Info and Status */
.mpvr-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    margin: 15px 0;
}

.mpvr-info-text {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

.mpvr-status {
    padding: 12px;
    margin: 15px 0;
    border-radius: 4px;
    font-weight: 500;
}

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

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

.mpvr-status.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Error message */
.mpvr-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 15px;
    margin: 15px 0;
}

/* Saved videos link */
.mpvr-saved-videos-link {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.mpvr-saved-videos-link a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.mpvr-saved-videos-link a:hover {
    text-decoration: underline;
}

/* Loading indicator */
.mpvr-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.mpvr-loading:before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .mpvr-modal-content {
        margin: 20px auto;
        width: 95%;
    }
    
    .mpvr-modal-body {
        padding: 15px;
    }
    
    .mpvr-btn {
        display: block;
        width: 100%;
        margin: 10px 0;
    }
    
    .mpvr-controls {
        text-align: center;
    }
}

/* MemberPress integration */
.mepr-account-nav .mpvr-nav-item {
    display: inline-block;
}

.mepr-account-nav .mpvr-nav-item a {
    color: #0073aa;
    text-decoration: none;
    padding: 10px 15px;
    display: block;
}

.mepr-account-nav .mpvr-nav-item a:hover {
    background: #f8f9fa;
    border-radius: 4px;
}
