/* Popup Generator Styles */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --transition: all 0.15s ease-in-out;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
    overflow-x: hidden;
}

.h-100 {
    height: 100vh !important;
}

/* Settings Panel */
.settings-panel {
    background: white;
    border-right: 1px solid #dee2e6;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    overflow-y: auto;
    position: relative;
    z-index: 1000;
    height: 100vh;
}

.preview-panel {
    overflow: hidden;
    height: 100vh;
}

.settings-panel h2 {
    color: var(--dark-color);
    font-weight: 600;
    font-size: 1.5rem;
}

.settings-panel .nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.settings-panel .nav-tabs .nav-link {
    border: none;
    color: var(--secondary-color);
    font-weight: 500;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.settings-panel .nav-tabs .nav-link:hover {
    border-color: transparent;
    color: var(--primary-color);
}

.settings-panel .nav-tabs .nav-link.active {
    background-color: transparent;
    border-bottom: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

/* Template Selection Modal */
#templateModal .modal-dialog {
    max-height: 90vh;
}

#templateModal .modal-content {
    max-height: 90vh;
}

#templateModal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

.template-card {
    transition: all 0.2s ease-in-out;
    border: 2px solid transparent;
    height: 100%;
}

.template-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color) !important;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2) !important;
}

.template-card .fa-3x {
    margin-bottom: 1rem;
}

/* Form Controls */
.form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-control, .form-select {
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    padding: 0.5rem 0.75rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control-color {
    width: 100%;
    height: 38px;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    cursor: pointer;
}

.form-range {
    height: 1.5rem;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Trigger Settings */
.trigger-settings {
    animation: fadeIn 0.3s ease;
}

h4 {
    color: var(--dark-color);
    font-weight: 600;
    font-size: 1.1rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #eee;
}

h6 {
    color: var(--dark-color);
    font-weight: 600;
    font-size: 0.95rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #eee;
}

/* Preview Panel */
.preview-panel {
    background: #f8f9fa;
    border-left: 1px solid #dee2e6;
    overflow-y: auto;
    position: relative;
}

.preview-header {
    background: white;
    border-bottom: 1px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 999;
}

.preview-header h5 {
    color: var(--dark-color);
    font-weight: 600;
}

.preview-content {
    height: calc(100vh - 80px);
    overflow-y: auto;
    position: relative;
}

.preview-page {
    background: white;
    padding: 2rem;
    margin: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    min-height: calc(100vh - 120px);
}

/* Buttons */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.btn-outline-success {
    color: var(--success-color);
    border-color: var(--success-color);
}

.btn-outline-success:hover {
    background-color: var(--success-color);
    border-color: var(--success-color);
    transform: translateY(-1px);
}

.btn-outline-secondary {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-outline-secondary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-1px);
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    color: #0c5460;
    border-left: 3px solid var(--info-color);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #856404;
    border-left: 3px solid var(--warning-color);
}

/* Modal Styles */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

.modal-title {
    font-weight: 600;
    color: var(--dark-color);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

/* Code Display */
pre {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
    font-size: 0.875rem;
    line-height: 1.4;
}

code {
    color: #e83e8c;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.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 var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Range Input Styling */
.form-range::-webkit-slider-thumb {
    background-color: var(--primary-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.form-range::-moz-range-thumb {
    background-color: var(--primary-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .settings-panel {
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }
    
    .preview-panel {
        border-top: 1px solid #dee2e6;
    }
    
    .preview-content {
        height: 50vh;
    }
}

@media (max-width: 767.98px) {
    .settings-panel .nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .btn-group .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .preview-page {
        padding: 1rem;
        margin: 0.5rem;
    }
}

/* Animation Classes */
.animate__animated {
    animation-duration: 0.3s;
    animation-fill-mode: both;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fadeIn {
    animation-name: fadeIn;
}

.slideIn {
    animation-name: slideIn;
}

/* Scroll Indicators */
.preview-content::-webkit-scrollbar {
    width: 8px;
}

.preview-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.preview-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.preview-content::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Focus States */
.form-control:focus,
.form-select:focus,
.btn:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Utility Classes */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.border-start {
    border-left: 1px solid #dee2e6 !important;
}

.border-end {
    border-right: 1px solid #dee2e6 !important;
}

.shadow-sm {
    box-shadow: var(--box-shadow) !important;
}

.rounded {
    border-radius: var(--border-radius) !important;
}
