/**
 * WP Chart Visualizer - Custom Styles
 * Additional styles for the plugin
 */

/* Base Styles */
.wpcv-chart-container {
    position: relative;
    padding: 1rem;
    background-color: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.wpcv-chart-container h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1f2937;
}

.wpcv-chart-wrapper {
    position: relative;
    width: 100%;
}

/* Admin Page Layout */
.wpcv-admin-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.wpcv-admin-main {
    flex: 1;
    min-width: 0;
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.wpcv-admin-sidebar {
    width: 100%;
    max-width: 20rem;
}

@media (min-width: 1024px) {
    .wpcv-admin-sidebar {
        width: 20rem;
    }
}

.wpcv-info-box {
    background-color: #ffffff;
    padding: 1.25rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    margin-bottom: 1rem;
}

.wpcv-info-box h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #1f2937;
}

.wpcv-info-box ol {
    list-style-type: decimal;
    list-style-position: inside;
    color: #4b5563;
}

.wpcv-info-box ol li {
    margin-bottom: 0.5rem;
}

.wpcv-info-box ul {
    list-style-type: disc;
    list-style-position: inside;
    font-size: 0.875rem;
    color: #4b5563;
}

.wpcv-info-box ul li {
    margin-bottom: 0.25rem;
}

.wpcv-info-box code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-family: monospace;
}

/* Form Elements */
.wpcv-form .form-table th {
    font-weight: 500;
    color: #374151;
}

.wpcv-form select,
.wpcv-form input[type="text"] {
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.wpcv-form select:focus,
.wpcv-form input[type="text"]:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.wpcv-form .description {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Preview Section */
.wpcv-preview-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
}

.wpcv-preview-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1f2937;
}

#chart-preview-container {
    background-color: #f3f4f6;
    padding: 1.25rem;
    border-radius: 0.375rem;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Shortcode Section */
.wpcv-shortcode-section {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background-color: #dbeafe;
    border-radius: 0.5rem;
}

.wpcv-shortcode-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #1f2937;
}

.shortcode-display {
    display: flex;
    gap: 0.5rem;
}

#generated-shortcode {
    flex: 1;
    font-family: monospace;
    font-size: 0.875rem;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
}

#copy-shortcode {
    padding: 0.5rem 1rem;
    background-color: #3b82f6;
    color: #ffffff;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

#copy-shortcode:hover {
    background-color: #2563eb;
}

/* Color Picker */
.color-picker-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.wp-picker-container {
    display: inline-block;
}

#add-color {
    padding: 0.25rem 0.75rem;
    background-color: #e5e7eb;
    color: #374151;
    border-radius: 0.25rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

#add-color:hover {
    background-color: #d1d5db;
}

/* WordPress Admin Overrides */
.wrap .button-primary {
    background-color: #3b82f6 !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
}

.wrap .button-primary:hover {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
}

.wrap .button-secondary {
    background-color: #e5e7eb !important;
    border-color: #e5e7eb !important;
    color: #374151 !important;
}

.wrap .button-secondary:hover {
    background-color: #d1d5db !important;
    border-color: #d1d5db !important;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .wpcv-chart-container {
        padding: 0.75rem;
    }
    
    .wpcv-admin-container {
        flex-direction: column;
    }
    
    .wpcv-admin-sidebar {
        width: 100%;
        max-width: none;
    }
}

/* Loading States */
.wpcv-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 16rem;
}

.wpcv-loading::after {
    content: "";
    width: 2.5rem;
    height: 2.5rem;
    border: 4px solid #3b82f6;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error States */
.wpcv-error {
    background-color: #fee;
    border: 1px solid #fcc;
    color: #c00;
    padding: 1rem;
    border-radius: 0.375rem;
    margin: 1rem 0;
}

/* Success Messages */
.wpcv-success {
    background-color: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 1rem;
    border-radius: 0.375rem;
    margin: 1rem 0;
}