/* Grid Layout Calculator Styles */
/* All classes prefixed with 'glc-' to avoid conflicts */

* {
    box-sizing: border-box;
}

.glc-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
}

.glc-main-title {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
    margin: 0 0 32px 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.glc-main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Controls Panel */
.glc-controls-panel {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    height: fit-content;
}

.glc-preview-panel {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    height: fit-content;
}

.glc-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.glc-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.glc-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.glc-help-text {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 16px 0;
}

/* Template Buttons */
.glc-templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.glc-template-btn {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 8px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.glc-template-btn:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
    transform: translateY(-1px);
}

/* Breakpoint Tabs */
.glc-breakpoint-tabs {
    display: flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 16px;
}

.glc-breakpoint-tab {
    flex: 1;
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.glc-breakpoint-tab.glc-active {
    background: white;
    color: #3b82f6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.glc-breakpoint-icon {
    font-size: 14px;
}

/* Form Controls */
.glc-dimension-controls,
.glc-gap-controls,
.glc-container-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.glc-alignment-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.glc-control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.glc-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.glc-input,
.glc-select {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    background: white;
}

.glc-input:focus,
.glc-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.glc-number-input {
    display: flex;
    align-items: center;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    overflow: hidden;
}

.glc-number-input input {
    border: none;
    flex: 1;
    text-align: center;
    padding: 8px 4px;
}

.glc-number-input input:focus {
    box-shadow: none;
}

.glc-increment,
.glc-decrement {
    background: #f8fafc;
    border: none;
    padding: 8px 12px;
    font-size: 16px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-width: 36px;
}

.glc-increment:hover,
.glc-decrement:hover {
    background: #e2e8f0;
}

.glc-input-with-unit {
    display: flex;
    align-items: center;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    overflow: hidden;
}

.glc-input-with-unit input {
    border: none;
    flex: 1;
    padding: 8px 12px;
}

.glc-input-with-unit input:focus {
    box-shadow: none;
}

.glc-unit {
    background: #f8fafc;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    border-left: 1px solid #e5e7eb;
}

/* Track Sizes */
.glc-track-sizes {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.glc-track-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.glc-track-title {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin: 0;
}

.glc-track-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.glc-track-input-group {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    min-width: 120px;
}

.glc-track-input-group input {
    border: none;
    padding: 6px 8px;
    font-size: 13px;
    width: 60px;
    text-align: center;
}

.glc-track-input-group input:focus {
    outline: none;
}

.glc-track-arrow-btn {
    background: #f8fafc;
    border: none;
    padding: 6px 8px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glc-track-arrow-btn:hover {
    background: #e2e8f0;
}

/* Item Constraints */
.glc-item-constraints {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.glc-item-constraint {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
}

.glc-item-constraint-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px 0;
}

.glc-constraint-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.glc-constraint-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.glc-constraint-label {
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.glc-constraint-input-with-btn {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    overflow: hidden;
}

.glc-constraint-input-with-btn input {
    border: none;
    padding: 4px 6px;
    font-size: 12px;
    flex: 1;
    min-width: 0;
}

.glc-constraint-input-with-btn input:focus {
    outline: none;
}

.glc-constraint-btn {
    background: #f3f4f6;
    border: none;
    padding: 4px 6px;
    font-size: 10px;
    color: #6b7280;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glc-constraint-btn:hover {
    background: #e5e7eb;
}

/* Checkboxes */
.glc-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    user-select: none;
}

.glc-checkbox {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.glc-checkbox:checked {
    background: #3b82f6;
    border-color: #3b82f6;
}

.glc-checkmark {
    position: absolute;
    left: -18px;
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.glc-checkbox:checked + .glc-checkmark::after {
    content: '✓';
    position: absolute;
    left: 3px;
    top: -1px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Action Buttons */
.glc-action-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.glc-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.glc-btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #e2e8f0;
}

.glc-btn-secondary:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

/* Grid Preview */
.glc-preview-container {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    overflow: auto;
    min-height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.glc-grid-preview {
    display: grid;

    border-radius: 4px;
    background: white;
    position: relative;
}

.glc-grid-item {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.glc-grid-item:hover {
    transform: scale(1.02);
    background: #e2e8f0;
    border-color: #94a3b8;
    z-index: 10;
}

/* CSS Output */
.glc-css-output {
    position: relative;
    background: #1e293b;
    border-radius: 8px;
    overflow: hidden;
}

.glc-copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #3b82f6;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    z-index: 10;
}

.glc-copy-btn:hover {
    background: #2563eb;
}

.glc-copy-btn.glc-copied {
    background: #10b981;
}

.glc-css-code {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre;
    max-height: 400px;
    overflow-y: auto;
}

/* Info Panel */
.glc-info-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
}

.glc-info-panel h4 {
    color: #1f2937;
    margin: 0 0 8px 0;
    font-size: 15px;
}

.glc-info-panel p {
    color: #6b7280;
    margin: 0 0 12px 0;
}

.glc-info-panel p:last-child {
    margin-bottom: 0;
}

/* Guidelines Section */
.glc-guidelines {
    max-width: 1400px;
    margin: 40px auto 0;
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.glc-guidelines-title {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
    margin: 0 0 32px 0;
}

.glc-tutorial-steps {
    display: grid;
    gap: 24px;
    margin-bottom: 40px;
}

.glc-tutorial-step {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid #3b82f6;
    transition: transform 0.2s ease;
}

.glc-tutorial-step:hover {
    transform: translateX(4px);
}

.glc-step-number {
    background: #3b82f6;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.glc-step-content h3 {
    color: #1f2937;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.glc-step-content p {
    color: #6b7280;
    margin: 0;
    line-height: 1.6;
}

.glc-pro-tips {
    margin-bottom: 32px;
}

.glc-pro-tips h3 {
    font-size: 22px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 20px 0;
}

.glc-tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.glc-tip {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 16px;
}

.glc-tip h4 {
    color: #92400e;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.glc-tip p {
    color: #78350f;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.glc-tip code {
    background: rgba(146, 64, 14, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
}

.glc-common-patterns h3 {
    font-size: 22px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 20px 0;
}

.glc-patterns-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.glc-pattern {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.glc-pattern strong {
    color: #1e293b;
}

.glc-pattern code {
    background: #e2e8f0;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    color: #1e293b;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .glc-main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .glc-dimension-controls,
    .glc-gap-controls,
    .glc-container-controls {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .glc-alignment-controls {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

@media (max-width: 768px) {
    .glc-container {
        padding: 12px;
    }
    
    .glc-controls-panel,
    .glc-preview-panel {
        padding: 16px;
    }
    
    .glc-templates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .glc-breakpoint-tabs {
        flex-direction: column;
        gap: 4px;
    }
    
    .glc-tutorial-step {
        flex-direction: column;
        gap: 12px;
    }
    
    .glc-tips-grid {
        grid-template-columns: 1fr;
    }
    
    .glc-action-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
}