:root {
    --primary: #4361ee;
    --secondary: #3a0ca3;
    --accent: #4cc9f0;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --gray: #95a5a6;
    --border: #e0e0e0;
    --radius: 8px;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    padding: 10px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: cover;
}

.header-content {
    position: relative;
    z-index: 1;
}

.header-content h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.header-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.header-stats span {
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

/* Mobile Header Dropdown */
.mobile-schema-header {
    display: none;
    background: var(--primary);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.mobile-schema-dropdown {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--radius);
    border: 2px solid white;
    background: white;
    font-size: 1rem;
    font-weight: 600;
}

/* Main Layout */
.main-wrapper {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: calc(100vh - 300px);
}

/* Sidebar */
.sidebar {
    background: var(--light);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    overflow-y: auto;
}

.schema-types h3,
.quick-actions h3,
.schema-info h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.type-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.type-item {
    padding: 1rem;
    background: white;
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
}

.type-item:hover {
    transform: translateX(5px);
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.type-item.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-color: var(--primary);
}

.type-item i {
    font-size: 1.2rem;
    width: 24px;
}

.type-item span {
    flex: 1;
    font-weight: 600;
}

.type-item small {
    font-size: 0.8rem;
    opacity: 0.8;
}

.quick-actions {
    margin-top: 2rem;
}

.quick-btn {
    width: 100%;
    margin-bottom: 0.5rem;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
}

.schema-info {
    margin-top: 2rem;
    padding: 1rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

#current-schema-info {
    font-size: 0.9rem;
    color: var(--gray);
}

/* Main Content */
.main-content {
    padding: 1.5rem;
    overflow-y: auto;
}

/* Form Container */
.form-container {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.schema-form {
    display: none;
    animation: fadeIn 0.3s ease;
}

.schema-form.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.form-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.form-header h2 {
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
}

.form-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.tab-btn {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    background: var(--light);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.tab-content {
    display: none;
    padding: 1.5rem;
}

.tab-content.active {
    display: block;
}

/* Form Elements */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

/* Dynamic Items */
.breadcrumb-item,
.social-item,
.contact-item,
.hours-item,
.review-item {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
    padding: 0.5rem;
    background: var(--light);
    border-radius: var(--radius);
}

.hours-item {
    grid-template-columns: 1fr 1fr 1fr auto;
}

.review-item {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    grid-template-rows: auto auto;
    padding: 1rem;
    margin-bottom: 1rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.review-item textarea {
    grid-column: 1 / -1;
}

.remove-bc,
.remove-social,
.remove-contact,
.remove-hours,
.remove-review {
    background: var(--danger);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.remove-bc:hover,
.remove-social:hover,
.remove-contact:hover,
.remove-hours:hover,
.remove-review:hover {
    background: #c0392b;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

.btn-secondary {
    background: var(--gray);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-info {
    background: var(--accent);
    color: white;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Actions Container */
.actions-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Output Container */
.output-container {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.output-header {
    background: var(--dark);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.output-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.output-actions {
    display: flex;
    gap: 0.5rem;
}

.code-output {
    background: #1a1a1a;
    color: #f8f8f2;
    padding: 1.5rem;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    max-height: 400px;
    overflow-y: auto;
}

.code-output pre {
    margin: 0;
}

/* Syntax Highlighting */
.property { color: #66d9ef; }
.string { color: #a6e22e; }
.number { color: #ae81ff; }
.boolean { color: #fd971f; }
.null { color: #f92672; }
.key { color: #f8f8f2; }

.schema-preview {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
}

.schema-preview h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

#rich-preview {
    background: var(--light);
    padding: 1.5rem;
    border-radius: var(--radius);
    min-height: 100px;
}

/* Footer */
footer {
    background: var(--dark);
    color: white;
    padding: 2rem;
    margin-top: 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--accent);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-section a {
    color: var(--light);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--accent);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--success);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transform: translateX(150%);
    transition: var(--transition);
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

.notification.error {
    background: var(--danger);
}

/* Additional Styles */
.geo-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.select2-container {
    width: 100% !important;
}

.select2-selection {
    height: auto !important;
    min-height: 48px;
    border: 2px solid var(--border) !important;
    border-radius: var(--radius) !important;
}

.select2-selection:focus {
    border-color: var(--primary) !important;
    outline: none !important;
}

/* Mobile Responsive Styles */
@media (max-width: 1024px) {
    .mobile-schema-header {
        display: block;
    }
    
    .main-wrapper {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: block !important;
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: 400px;
        overflow-y: auto;
    }
    
    .type-list {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.5rem;
    }
    
    .type-item {
        flex-direction: column;
        text-align: center;
        padding: 0.75rem;
        gap: 5px;
    }
    
    .type-item i {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .type-item span {
        font-size: 0.9rem;
    }
    
    .type-item small {
        display: none;
    }
    
    .quick-actions {
        display: none;
    }
    
    .form-container {
        margin-top: 1rem;
    }
    
    .actions-container {
        flex-direction: column;
    }
    
    .actions-container .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 768px) {
    header {
        padding: 1.5rem 1rem;
    }
    
    .header-content h1 {
        font-size: 2rem;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .header-stats {
        gap: 1rem;
    }
    
    .header-stats span {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .form-header {
        padding: 1rem;
    }
    
    .form-header h2 {
        font-size: 1.5rem;
    }
    
    .form-tabs {
        flex-wrap: wrap;
    }
    
    .tab-content {
        padding: 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .breadcrumb-item,
    .social-item,
    .contact-item,
    .hours-item {
        grid-template-columns: 1fr;
    }
    
    .hours-item {
        grid-template-columns: 1fr 1fr;
    }
    
    .review-item {
        grid-template-columns: 1fr;
    }
    
    .geo-inputs {
        grid-template-columns: 1fr;
    }
    
    .output-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .code-output {
        padding: 1rem;
        font-size: 0.85rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-section h4 {
        justify-content: center;
    }
    
    .footer-section a {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        border-radius: 0;
    }
    
    body {
        padding: 0;
    }
    
    header {
        padding: 1rem;
    }
    
    .header-content h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .type-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .type-item {
        padding: 0.5rem;
    }
    
    .type-item i {
        font-size: 1.2rem;
    }
    
    .form-header h2 {
        font-size: 1.3rem;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* Tablet Specific */
@media (min-width: 769px) and (max-width: 1024px) {
    .main-wrapper {
        grid-template-columns: 250px 1fr;
    }
    
    .sidebar {
        padding: 1rem;
    }
    
    .type-item {
        padding: 0.75rem;
    }
    
    .type-item i {
        font-size: 1rem;
    }
    
    .type-item span {
        font-size: 0.85rem;
    }
}

/* Schema form visibility - Important Fix */
#website-form {
    display: block;
}

.schema-form:not(.active) {
    display: none;
}

.schema-form.active {
    display: block;
}

.tab-content:not(.active) {
    display: none;
}

.tab-content.active {
    display: block;
}