/* Silo Link Checker Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 5px;
    backdrop-filter: blur(10px);
}

.tab-button {
    flex: 1;
    max-width: 200px;
    background: transparent;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.tab-button:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.tab-button.active {
    background: white;
    color: #333;
    opacity: 1;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-hint {
    display: block;
    margin-top: 8px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.form-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.input-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

button[type="submit"] {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

button[type="submit"]:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

button[type="submit"]:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.results-section {
    margin-top: 30px;
}

.summary-card, .details-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.summary-card h2, .details-card h2 {
    margin-bottom: 20px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.stat.success {
    background: #d4edda;
    border-color: #c3e6cb;
}

.stat.warning {
    background: #fff3cd;
    border-color: #ffeaa7;
}

.stat.error {
    background: #f8d7da;
    border-color: #f5c6cb;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

.result-card {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.result-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.result-header {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
}

.result-header.success {
    background: #d4edda;
    border-bottom: 1px solid #c3e6cb;
}

.result-header.warning {
    background: #fff3cd;
    border-bottom: 1px solid #ffeaa7;
}

.result-header.error {
    background: #f8d7da;
    border-bottom: 1px solid #f5c6cb;
}

.status-icon {
    font-size: 1.2rem;
}

.result-title h3 {
    margin: 0;
    font-size: 1.1rem;
}

.result-details {
    padding: 20px;
}

.url-info, .link-info, .error-info, .headings-info {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.url-info:last-child, .link-info:last-child, .error-info:last-child, .headings-info:last-child {
    margin-bottom: 0;
}

.link-info.success {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

.error-info {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
}

.url-link {
    color: #667eea;
    text-decoration: none;
    word-break: break-all;
}

.url-link:hover {
    text-decoration: underline;
}

.link-text {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #495057;
}

/* Headings Styles */
.headings-info {
    background: #f0f8ff;
    border-left: 4px solid #007bff;
}

.headings-section {
    margin-top: 5px;
}

.heading-group {
    margin-bottom: 12px;
}

.heading-group:last-child {
    margin-bottom: 0;
}

.heading-label {
    display: inline-block;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.heading-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.heading-list li {
    background: white;
    padding: 8px 12px;
    margin-bottom: 4px;
    border-radius: 4px;
    border-left: 3px solid #007bff;
    word-wrap: break-word;
    font-size: 0.95rem;
    line-height: 1.4;
}

.heading-list li:last-child {
    margin-bottom: 0;
}

.no-headings {
    color: #6c757d;
    font-style: italic;
    font-size: 0.9rem;
}

/* Sitemap Tree Visualization */
.tree-container {
    margin-bottom: 40px;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 20px;
    background: #fafbfc;
    overflow-x: auto;
    min-width: 100%;
}

.tree-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.tree-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.4rem;
}

.tree-stats {
    display: flex;
    gap: 20px;
}

.tree-stat {
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.tree-diagram {
    overflow-x: auto;
    padding: 20px 0;
    min-width: 100%;
    white-space: nowrap;
}

.tree-node {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    white-space: normal;
}

.node-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.node-box {
    background: white;
    border: 3px solid #667eea;
    border-radius: 12px;
    padding: 15px 20px;
    min-width: 300px;
    max-width: 600px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    margin-bottom: 10px;
}

.node-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    border-color: #5a67d8;
}

.node-title {
    font-weight: bold;
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-title-link {
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.node-title-link:hover {
    color: #667eea;
    text-decoration: underline;
}

.node-info-row {
    font-size: 0.8rem;
    margin-bottom: 6px;
    text-align: left;
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-info-row strong {
    color: #667eea;
    font-weight: 600;
}

.node-url {
    font-size: 0.8rem;
    color: #667eea;
    word-break: break-all;
    margin-bottom: 10px;
}

.node-headings {
    text-align: left;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
    margin-top: 10px;
    border-left: 4px solid #667eea;
}

.node-headings .heading-group {
    margin-bottom: 6px;
    font-size: 0.85rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-headings .heading-group:last-child {
    margin-bottom: 0;
}

.node-headings strong {
    color: #667eea;
    font-weight: 600;
}

.heading-item {
    margin-left: 10px;
    margin-bottom: 3px;
    font-size: 0.85rem;
    line-height: 1.3;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.heading-item:last-child {
    margin-bottom: 0;
}

/* Tree Connectors */
.node-connector {
    width: 3px;
    height: 30px;
    background: #667eea;
    margin: 0 auto;
    position: relative;
}

.children-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    position: relative;
    margin-top: 10px;
    flex-wrap: nowrap;
    min-width: max-content;
}

.children-container::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    right: 50%;
    height: 3px;
    background: #667eea;
    transform: translateX(-50%);
    width: calc(100% - 80px);
    min-width: max(200px, calc(100% - 80px));
}

.children-container .tree-node::before {
    content: '';
    position: absolute;
    top: -30px;
    left: 50%;
    width: 3px;
    height: 30px;
    background: #667eea;
    transform: translateX(-50%);
}

/* Level-specific styling */
.level-0 .node-box {
    border-color: #28a745;
    background: linear-gradient(135deg, #d4edda, #ffffff);
}

.level-0 .node-title {
    color: #155724;
}

.level-1 .node-box {
    border-color: #667eea;
}

.level-2 .node-box {
    border-color: #fd7e14;
}

.level-3 .node-box {
    border-color: #e83e8c;
}

.level-4 .node-box {
    border-color: #6f42c1;
}

/* No trees message */
.no-trees {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    font-size: 1.1rem;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #dee2e6;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 10px;
    border: 1px solid #f5c6cb;
    margin-top: 20px;
}

footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .form-section, .summary-card, .details-card {
        padding: 20px;
    }
    
    .summary-stats {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 15px;
    }
    
    .stat {
        padding: 15px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .summary-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .tab-navigation {
        flex-direction: column;
        gap: 5px;
    }
    
    .tab-button {
        max-width: none;
    }
    
    .tree-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .tree-stats {
        flex-direction: column;
        gap: 5px;
    }
    
    .children-container {
        flex-direction: row;
        gap: 20px;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .node-box {
        min-width: 250px;
        max-width: 400px;
    }
}

/* ========================================
   ENHANCED MODERN DESIGN (DEFAULT)
   ======================================== */

/* Enhanced Modern styling applied to all elements */
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

.form-section,
.summary-card,
.details-card,
.tree-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1), 0 8px 16px rgba(0,0,0,0.1);
}

.node-box {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.node-box:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.stat {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}
