/**
 * Border Animation Builder Enhanced Styles
 * 
 * Modern, responsive styles for the Border Animation Builder
 * 
 * @package Reia\BorderAnimations
 * @version 2.0.0
 * @author REIA Development Team
 * @license MIT
 */

/* ==========================================================================
   Builder Interface Styles
   ========================================================================== */

.border-animation-builder {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.builder-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.builder-header h2 {
    margin: 0 0 10px 0;
    font-size: 2.5em;
    font-weight: 300;
}

.builder-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1em;
}

.builder-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 600px;
}

/* ==========================================================================
   Controls Panel
   ========================================================================== */

.controls-panel {
    padding: 30px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
}

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

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 0.95em;
}

.control-group select,
.control-group input[type="text"],
.control-group input[type="range"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.control-group select:focus,
.control-group input[type="text"]:focus,
.control-group input[type="range"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.control-group input[type="color"] {
    width: 100%;
    height: 45px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-group input[type="color"]:hover {
    border-color: #667eea;
}

/* Range slider styling */
.control-group input[type="range"] {
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #e9ecef;
    border: none;
    border-radius: 3px;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Presets Section
   ========================================================================== */

.presets-section {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #e9ecef;
}

.presets-section h3 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1.1em;
    font-weight: 600;
}

.presets-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.preset-btn {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    background: white;
    color: #495057;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.preset-btn:hover {
    border-color: #667eea;
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

/* ==========================================================================
   Preview Panel
   ========================================================================== */

.preview-panel {
    padding: 30px;
    background: white;
    display: flex;
    flex-direction: column;
}

.preview-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: 
        linear-gradient(45deg, #f8f9fa 25%, transparent 25%),
        linear-gradient(-45deg, #f8f9fa 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f8f9fa 75%),
        linear-gradient(-45deg, transparent 75%, #f8f9fa 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    border-radius: 8px;
    margin-bottom: 20px;
    min-height: 300px;
}

.preview-element {
    background: white;
    color: #495057;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    min-width: 200px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Code Output Section
   ========================================================================== */

.code-section {
    background: #2d3748;
    border-radius: 8px;
    overflow: hidden;
}

.code-header {
    background: #1a202c;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-header h3 {
    margin: 0;
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 500;
}

.code-actions {
    display: flex;
    gap: 10px;
}

.code-actions button {
    padding: 6px 12px;
    border: 1px solid #4a5568;
    border-radius: 4px;
    background: #2d3748;
    color: #e2e8f0;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.code-actions button:hover {
    background: #4a5568;
    border-color: #667eea;
}

.code-output {
    padding: 20px;
    background: #2d3748;
    color: #e2e8f0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
    margin: 0;
}

/* ==========================================================================
   Action Buttons
   ========================================================================== */

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding: 25px 30px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.action-btn {
    padding: 12px 24px;
    border: 2px solid transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.action-btn.primary {
    background: #667eea;
    color: white;
}

.action-btn.primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.action-btn.secondary {
    background: transparent;
    color: #667eea;
    border-color: #667eea;
}

.action-btn.secondary:hover {
    background: #667eea;
    color: white;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .builder-content {
        grid-template-columns: 1fr;
    }
    
    .controls-panel {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    .presets-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .builder-header h2 {
        font-size: 2em;
    }
}

@media (max-width: 480px) {
    .border-animation-builder {
        margin: 10px;
        border-radius: 8px;
    }
    
    .controls-panel,
    .preview-panel {
        padding: 20px;
    }
    
    .builder-header {
        padding: 20px;
    }
    
    .builder-header h2 {
        font-size: 1.8em;
    }
}

/* ==========================================================================
   Animation Classes - Enhanced from Original
   ========================================================================== */

/* Conic Gradient Animation */
.ba-conic {
    position: relative;
    border-radius: 1em;
    padding: 20px;
}

.ba-conic::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 1em;
    background: conic-gradient(
        from 0deg,
        #0073e6,
        #ac3033,
        #0073e6
    );
    animation: ba-spin 2s linear infinite;
    z-index: -1;
}

/* Sparkler Effect */
.ba-sparkler {
    position: relative;
    border-radius: 1em;
    padding: 20px;
    overflow: hidden;
}

.ba-sparkler::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 1em;
    background: linear-gradient(
        45deg,
        transparent 30%,
        #0073e6 50%,
        transparent 70%
    );
    animation: ba-sparkler 2s ease-in-out infinite;
    z-index: -1;
}

/* Neon Glow Effect */
.ba-neon {
    position: relative;
    border-radius: 1em;
    padding: 20px;
    border: 4px solid #0073e6;
    box-shadow: 
        0 0 10px #0073e6,
        0 0 20px #0073e6,
        0 0 40px #0073e6;
    animation: ba-neon-pulse 2s ease-in-out infinite alternate;
}

/* Gradient Animation */
.ba-gradient {
    position: relative;
    border-radius: 1em;
    padding: 20px;
    background: linear-gradient(45deg, #0073e6, #ac3033);
    background-size: 200% 200%;
    animation: ba-gradient-shift 2s ease infinite;
}

/* Dashed Border Animation */
.ba-dashed {
    position: relative;
    border-radius: 1em;
    padding: 20px;
    border: 4px dashed #0073e6;
    animation: ba-dash-rotate 2s linear infinite;
}

/* Wave Effect */
.ba-wave {
    position: relative;
    border-radius: 1em;
    padding: 20px;
    border: 4px solid transparent;
    background: 
        linear-gradient(white, white) padding-box,
        linear-gradient(45deg, #0073e6, #ac3033) border-box;
    animation: ba-wave 2s ease-in-out infinite;
}

/* ==========================================================================
   Enhanced Keyframes
   ========================================================================== */

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

@keyframes ba-sparkler {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

@keyframes ba-neon-pulse {
    0% { 
        box-shadow: 
            0 0 10px currentColor, 
            0 0 20px currentColor, 
            0 0 40px currentColor; 
    }
    100% { 
        box-shadow: 
            0 0 20px currentColor, 
            0 0 30px currentColor, 
            0 0 60px currentColor; 
    }
}

@keyframes ba-gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes ba-dash-rotate {
    to { transform: rotate(360deg); }
}

@keyframes ba-wave {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ==========================================================================
   Notification Styles
   ========================================================================== */

.border-animation-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.border-animation-notification.success {
    background: #28a745;
}

.border-animation-notification.error {
    background: #dc3545;
}

.border-animation-notification.info {
    background: #007bff;
}

/* ==========================================================================
   WordPress Admin Specific Styles
   ========================================================================== */

.wp-admin .border-animation-admin {
    background: white;
    padding: 20px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    margin-top: 20px;
}

.wp-admin .border-animation-usage {
    margin-top: 30px;
    padding: 20px;
    background: #f6f7f7;
    border-left: 4px solid #0073aa;
}

.wp-admin .border-animation-usage h2,
.wp-admin .border-animation-usage h3 {
    margin-top: 0;
}

.wp-admin .border-animation-usage code {
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: Consolas, Monaco, monospace;
}

.wp-admin .border-animation-usage ul {
    margin-left: 20px;
}

/* ==========================================================================
   Shortcode Wrapper Styles
   ========================================================================== */

.border-animation-shortcode {
    margin: 20px 0;
}

.border-animation-shortcode .border-animation-builder {
    max-width: 100%;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .border-animation-builder {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .builder-header {
        background: #f0f0f0 !important;
        color: #000 !important;
    }
    
    .action-buttons,
    .code-actions {
        display: none;
    }
}
