/**
 * BEMA Frontend Styles
 * WordPress Plugin Frontend Interface Styling
 */

/* BEMA Player Container */
.bema-player-container {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin: 20px 0;
}

.bema-player-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    color: #fff;
    font-size: 18px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

.bema-player-loading::before {
    content: "🎵";
    margin-right: 10px;
    animation: bema-pulse 2s ease-in-out infinite;
}

@keyframes bema-pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* BEMA Player Interface */
.bema-player-interface {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bema-player-header {
    text-align: center;
    margin-bottom: 20px;
}

.bema-player-title {
    font-size: 1.5em;
    font-weight: bold;
    margin: 0 0 5px 0;
}

.bema-player-subtitle {
    font-size: 0.9em;
    opacity: 0.8;
    margin: 0;
}

.bema-player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.bema-control-button {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 20px;
    color: white;
}

.bema-control-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.bema-control-button.play {
    width: 60px;
    height: 60px;
    font-size: 24px;
}

.bema-progress-container {
    margin: 15px 0;
}

.bema-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
}

.bema-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fff, #f0f0f0);
    border-radius: 3px;
    transition: width 0.1s ease;
    width: 0%;
}

.bema-time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    margin-top: 8px;
    opacity: 0.9;
}

/* Download Buttons */
.bema-download-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    margin: 10px 5px;
}

.bema-download-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    color: white;
    text-decoration: none;
}

.bema-download-button::before {
    content: "⬇️";
    font-size: 1.2em;
}

.bema-download-button.linux::before { content: "🐧"; }
.bema-download-button.windows::before { content: "🪟"; }
.bema-download-button.macos::before { content: "🍎"; }
.bema-download-button.ios::before { content: "📱"; }
.bema-download-button.android::before { content: "🤖"; }

/* License Form Styles (Frontend) */
.bema-license-form {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    padding: 30px;
    margin: 25px 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.bema-form-header {
    text-align: center;
    margin-bottom: 25px;
}

.bema-form-header h3 {
    color: #2c3e50;
    font-size: 1.8em;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.bema-form-description {
    color: #7f8c8d;
    font-size: 1.1em;
    margin: 0;
    line-height: 1.5;
}

.bema-license-validation-form {
    max-width: 500px;
    margin: 0 auto;
}

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

.bema-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1em;
}

.bema-license-input,
.bema-platform-select {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    transition: all 0.3s ease;
    box-sizing: border-box;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.bema-license-input:focus,
.bema-platform-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.bema-form-help {
    display: block;
    margin-top: 6px;
    color: #7f8c8d;
    font-size: 0.9em;
    font-style: italic;
}

.bema-form-actions {
    text-align: center;
    margin-top: 30px;
}

.bema-validate-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    min-width: 180px;
}

.bema-validate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.bema-validate-button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.bema-form-spinner {
    margin-left: 15px;
    font-size: 1.3em;
    animation: bema-spin 1s linear infinite;
}

/* Validation Results */
.bema-validation-result {
    margin-top: 25px;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.bema-validation-result.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left: 4px solid #28a745;
    color: #155724;
}

.bema-validation-result.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.bema-validation-result h4 {
    margin: 0 0 15px 0;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bema-license-details {
    background: rgba(255, 255, 255, 0.7);
    padding: 18px;
    border-radius: 6px;
    margin-top: 15px;
    backdrop-filter: blur(5px);
}

.bema-license-details p {
    margin: 8px 0;
    font-size: 1.05em;
}

.bema-license-details strong {
    color: #2c3e50;
    font-weight: 600;
}

/* Redirect Information */
.bema-redirect-info {
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: 8px;
    margin-top: 20px;
}

.bema-success-message {
    color: #28a745;
    font-weight: 600;
    font-size: 1.2em;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.bema-success-message::before {
    content: "✅";
    font-size: 1.5em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bema-player-container {
        margin: 15px 0;
        border-radius: 6px;
    }
    
    .bema-player-interface {
        padding: 15px;
        min-height: 250px;
    }
    
    .bema-player-title {
        font-size: 1.3em;
    }
    
    .bema-player-controls {
        gap: 10px;
    }
    
    .bema-control-button {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .bema-control-button.play {
        width: 55px;
        height: 55px;
        font-size: 22px;
    }
    
    .bema-license-form {
        padding: 20px 15px;
        margin: 20px 0;
    }
    
    .bema-form-header h3 {
        font-size: 1.5em;
    }
    
    .bema-license-input,
    .bema-platform-select,
    .bema-validate-button {
        font-size: 14px;
        padding: 12px 15px;
    }
    
    .bema-download-button {
        padding: 10px 20px;
        font-size: 14px;
        margin: 8px 3px;
    }
    
    .bema-validation-result {
        padding: 15px;
    }
    
    .bema-license-details {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .bema-player-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .bema-license-validation-form {
        max-width: 100%;
    }
    
    .bema-validate-button {
        width: 100%;
        min-width: auto;
    }
    
    .bema-download-button {
        display: block;
        width: 100%;
        margin: 5px 0;
        text-align: center;
    }
}

/* Animation Keyframes */
@keyframes bema-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

@keyframes bema-slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .bema-license-form {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
        color: #ecf0f1;
    }
    
    .bema-form-header h3 {
        color: #ecf0f1;
    }
    
    .bema-form-description {
        color: #bdc3c7;
    }
    
    .bema-form-group label {
        color: #ecf0f1;
    }
    
    .bema-license-input,
    .bema-platform-select {
        background: #34495e;
        color: #ecf0f1;
        border-color: #4a5d6b;
    }
    
    .bema-license-details {
        background: rgba(0, 0, 0, 0.3);
        color: #ecf0f1;
    }
    
    .bema-license-details strong {
        color: #3498db;
    }
}

/* Accessibility */
.bema-player-container:focus-within {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.bema-control-button:focus,
.bema-validate-button:focus,
.bema-license-input:focus,
.bema-platform-select:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .bema-player-container {
        border: 2px solid #000;
    }
    
    .bema-control-button {
        border-width: 2px;
        border-color: #fff;
    }
    
    .bema-license-form {
        border: 2px solid #000;
    }
    
    .bema-validate-button {
        border: 2px solid #fff;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .bema-control-button,
    .bema-validate-button,
    .bema-download-button {
        transition: none;
    }
    
    .bema-form-spinner,
    .bema-player-loading::before {
        animation: none;
    }
}