/* ====================================
   HTML Table Generator - Complete Styling
   ==================================== */

/* Tool Page Common Styles */
.tool-page {
    padding-top: 0;
}

.breadcrumb {
    padding: 20px 0;
    font-size: 14px;
    color: #666;
}

.breadcrumb a {
    color: #666;
    transition: all 0.3s;
}

.breadcrumb a:hover {
    color: #1f6feb;
}

.breadcrumb .separator {
    margin: 0 10px;
    color: #ddd;
}

.breadcrumb .current {
    color: #333;
    font-weight: 600;
}

.tool-header {
    background: linear-gradient(135deg, #1f6feb 0%, #6c4ef5 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tool-header::before {
    content: '📋✨';
    position: absolute;
    font-size: 300px;
    opacity: 0.05;
    top: -50px;
    right: -50px;
    animation: rotate 20s linear infinite;
}

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

.tool-header-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.tool-icon-large {
    font-size: 72px;
    margin-bottom: 20px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.tool-header h1 {
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.tool-subtitle {
    font-size: 20px;
    opacity: 0.95;
    margin-bottom: 25px;
    line-height: 1.6;
}

.tool-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 16px;
}

.meta-separator {
    opacity: 0.5;
}

.tool-content {
    padding: 60px 20px;
    background: #f8f9fa;
}

/* Table Generator Root Container */
.tablegen-root {
    max-width: 1180px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 60px rgba(0,0,0,0.12);
    border: 2px solid rgba(31, 111, 235, 0.1);
}

/* Controls Section */
.tablegen-controls {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.control-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.control-row label {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.control-row input[type="number"],
.control-row input[type="text"] {
    padding: 10px 12px;
    border-radius: 8px;
    border: 2px solid rgba(0,0,0,0.1);
    font-weight: 600;
    min-width: 100px;
    font-size: 14px;
    transition: all 0.3s;
}

.control-row input[type="number"]:focus,
.control-row input[type="text"]:focus {
    outline: none;
    border-color: #1f6feb;
    box-shadow: 0 0 0 4px rgba(31, 111, 235, 0.1);
}

.control-row input[type="file"] {
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid rgba(0,0,0,0.1);
    background: white;
    font-size: 14px;
}

.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
}

.checkbox-inline input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #1f6feb;
}

/* Buttons */
.btn {
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    background: #f3f4f6;
    color: #0b1220;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #1f6feb 0%, #6c4ef5 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(31, 111, 235, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(31, 111, 235, 0.4);
}

.btn-ghost {
    background: white;
    border: 2px solid rgba(0,0,0,0.1);
    color: #1f2937;
}

.btn-ghost:hover {
    border-color: #1f6feb;
    color: #1f6feb;
}

/* Body Layout */
.tablegen-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    align-items: start;
}

.editor-panel,
.output-panel {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 25px;
    border-radius: 15px;
    border: 2px solid rgba(31, 111, 235, 0.1);
	    overflow: scroll;
}

.editor-panel h3,
.output-panel h3 {
    color: #1f6feb;
    font-size: 20px;
    margin-bottom: 15px;
    font-weight: 700;
}

/* Table Canvas Wrapper */
.table-canvas-outer {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
    background: white;
    border-radius: 10px;
    border: 2px solid rgba(0,0,0,0.06);
    min-height: 250px;
}

#tableCanvasWrapper {
    min-height: 200px;
    display: block;
    width: 100%;
}

/* Notice when table is empty */
.notice {
    color: #6b7280;
    font-style: italic;
    padding: 40px 20px;
    text-align: center;
    font-size: 15px;
}

/* Editable Table */
.editable-table {
    border-collapse: collapse;
    display: inline-table;
    min-width: max-content;
    max-width: none;
    table-layout: auto;
    background: white;
}

.editable-table th,
.editable-table td {
    border: 2px solid rgba(31, 111, 235, 0.2);
    padding: 10px 14px;
    min-width: 120px;
    text-align: left;
    vertical-align: top;
    white-space: normal;
    word-break: break-word;
    font-size: 14px;
    transition: all 0.2s;
}

.editable-table th {
    background: linear-gradient(135deg, #e0f2fe 0%, #bfdbfe 100%);
    font-weight: 800;
    color: #1e40af;
}

.editable-table td:hover {
    background: #f0f9ff;
}

.editable-table td:focus,
.editable-table th:focus {
    outline: 3px solid rgba(31, 111, 235, 0.5);
    outline-offset: 2px;
    background: #fef3c7;
}

/* Output Textarea */
#tableHtmlOutput {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: 2px solid rgba(0,0,0,0.1);
    font-family: 'Courier New', Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
    background: #f9fafb;
    resize: vertical;
    min-height: 300px;
}

#tableHtmlOutput:focus {
    outline: none;
    border-color: #1f6feb;
    box-shadow: 0 0 0 4px rgba(31, 111, 235, 0.1);
}

/* Live Preview */
.render-preview {
    margin-top: 20px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(0,0,0,0.06);
    background: white;
}

.render-preview h4 {
    padding: 12px 15px;
    background: linear-gradient(135deg, #e0f2fe 0%, #bfdbfe 100%);
    color: #1e40af;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    border-bottom: 2px solid rgba(31, 111, 235, 0.2);
}

.render-preview iframe {
    width: 100%;
    height: 280px;
    border: 0;
    display: block;
    background: white;
}

/* Examples Section */
.examples {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid rgba(31, 111, 235, 0.1);
}

.examples h4 {
    color: #1f6feb;
    font-size: 20px;
    margin-bottom: 15px;
    font-weight: 700;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.example-card {
    padding: 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid rgba(31, 111, 235, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.example-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(31, 111, 235, 0.2);
    border-color: #1f6feb;
}

.example-card strong {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 8px;
}

.example-code {
    font-family: 'Courier New', Consolas, monospace;
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
}

/* Hint Text */
.hint {
    font-size: 13px;
    color: #6b7280;
    margin-top: 12px;
    font-style: italic;
    line-height: 1.6;
}

/* Info Box */
.css-info-box {
    background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
    border-left: 5px solid #F59E0B;
    padding: 30px;
    border-radius: 15px;
    margin-top: 30px;
}

.css-info-box h4 {
    color: #B45309;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 700;
}

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

.info-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    line-height: 1.7;
    font-size: 14px;
    color: #555;
    border: 2px solid rgba(245, 158, 11, 0.2);
}

.info-item strong {
    color: #B45309;
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
}

/* SEO Content Section */
.seo-content {
    padding: 80px 20px;
    background: white;
}

.content-article {
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.8;
}

.content-article h2 {
    font-size: 32px;
    font-weight: 800;
    margin-top: 40px;
    margin-bottom: 20px;
    color: #333;
}

.content-article h2:first-child {
    margin-top: 0;
}

.content-article h3 {
    font-size: 24px;
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #333;
}

.content-article p {
    margin-bottom: 20px;
    color: #666;
    font-size: 16px;
}

.content-article ul,
.content-article ol {
    margin-bottom: 25px;
    padding-left: 30px;
    color: #666;
}

.content-article li {
    margin-bottom: 12px;
    line-height: 1.8;
}

.content-article strong {
    color: #333;
    font-weight: 700;
}

/* Related Tools */
.related-tools {
    max-width: 900px;
    margin: 60px auto 0;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 15px;
}

.related-tools h3 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 30px;
    text-align: center;
    color: #1f6feb;
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.related-tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 25px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
}

.related-tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #1f6feb;
}

.related-tool-card .tool-icon {
    font-size: 42px;
}

.related-tool-card .tool-name {
    font-weight: 700;
    color: #333;
    font-size: 16px;
}

/* Notification Toast */
.barcode-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #1f6feb 0%, #6c4ef5 100%);
    color: white;
    padding: 15px 22px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    font-size: 15px;
    font-weight: 600;
    z-index: 10000;
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .tablegen-body {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .tool-header h1 {
        font-size: 32px;
    }
    
    .tool-subtitle {
        font-size: 16px;
    }
    
    .tool-icon-large {
        font-size: 52px;
    }
    
    .tablegen-root {
        padding: 20px;
    }
    
    .control-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-row input[type="number"],
    .control-row input[type="text"] {
        width: 100%;
        min-width: 0;
    }
    
    .control-row .btn {
        width: 100%;
        justify-content: center;
    }
    
    .examples-grid {
        grid-template-columns: 1fr;
    }
    
    .render-preview iframe {
        height: 220px;
    }
    
    .editor-panel,
    .output-panel {
        padding: 20px;
    }
    
    .content-article h2 {
        font-size: 26px;
    }
    
    .content-article h3 {
        font-size: 20px;
    }
    
    .editable-table th,
    .editable-table td {
        min-width: 100px;
        padding: 8px 10px;
        font-size: 13px;
    }
}

@media (max-width: 520px) {
    .tool-header {
        padding: 40px 20px;
    }
    
    .tool-header h1 {
        font-size: 28px;
    }
    
    .tablegen-controls {
        gap: 10px;
    }
    
    .control-row {
        gap: 8px;
    }
    
    .examples-grid {
        gap: 10px;
    }
    
    .editable-table th,
    .editable-table td {
        min-width: 90px;
        padding: 6px 8px;
        font-size: 12px;
    }
    
    #tableHtmlOutput {
        min-height: 200px;
        font-size: 12px;
    }
    
    .barcode-notification {
        bottom: 20px;
        right: 20px;
        left: 20px;
        font-size: 14px;
    }
}

/* Print Styles */
@media print {
    .tool-header,
    .tablegen-controls,
    .related-tools,
    .barcode-notification {
        display: none;
    }
    
    .tablegen-body {
        grid-template-columns: 1fr;
    }
    
    .editor-panel {
        page-break-inside: avoid;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
.table-canvas-outer::-webkit-scrollbar,
#tableHtmlOutput::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.table-canvas-outer::-webkit-scrollbar-track,
#tableHtmlOutput::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.table-canvas-outer::-webkit-scrollbar-thumb,
#tableHtmlOutput::-webkit-scrollbar-thumb {
    background: #1f6feb;
    border-radius: 5px;
}

.table-canvas-outer::-webkit-scrollbar-thumb:hover,
#tableHtmlOutput::-webkit-scrollbar-thumb:hover {
    background: #1557c0;
}