* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.95;
}

main {
    padding: 30px;
}

/* Tab Styles */
.tabs-container {
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 30px;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    padding: 8px 8px 0 8px;
}

.tabs {
    display: flex;
    gap: 8px;
}

.tab-button {
    background: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: -2px;
    border-bottom: 2px solid transparent;
}

.tab-button:hover {
    color: #667eea;
    background: #f0f0f0;
}

.tab-button.active {
    color: #667eea;
    background: white;
    border-bottom-color: white;
    box-shadow: 0 -2px 8px rgba(102, 126, 234, 0.1);
}

.tab-icon {
    font-size: 18px;
}

.tab-text {
    font-size: 15px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

.input-section {
    margin-bottom: 30px;
}

.input-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    font-size: 1.1em;
}

#naturalLanguageInput {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

#naturalLanguageInput:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 2px solid #e0e0e0;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #e8e8e8;
}

.btn-chatgpt {
    background: #10a37f;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-chatgpt:hover {
    background: #0d8f6e;
}

.result-section {
    margin-top: 30px;
    animation: fadeIn 0.5s;
}

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

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.result-header h2 {
    color: #333;
    font-size: 1.5em;
}

.output-box {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.8;
    color: #333;
    max-height: 500px;
    overflow-y: auto;
}

.actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.loading-section {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #666;
    border-top: 1px solid #e0e0e0;
}

footer a {
    color: #667eea;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s;
    z-index: 1000;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Tested Responses Styles */
.tested-responses-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.tested-responses-header h2 {
    color: #333;
    font-size: 1.8em;
}

.responses-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.response-card {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    position: relative;
}

.response-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.response-card-title {
    font-weight: 600;
    font-size: 1.2em;
    color: #333;
    flex: 1;
    min-width: 200px;
}

.response-card-title-static {
    font-weight: 600;
    font-size: 1.2em;
    color: #333;
    margin: 0;
}

.response-text-static {
    white-space: pre-wrap;
    line-height: 1.8;
    color: #333;
}

/* Comparison Styles */
.comparison-card {
    border: 2px solid #667eea;
}

.comparison-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    margin-bottom: 25px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.comparison-column {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
}

.comparison-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
}

.comparison-content {
    font-size: 13px;
    line-height: 1.7;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.comparison-content.story-content {
    font-size: 12px;
    line-height: 1.7;
    max-height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
    background: #fafafa;
    border-radius: 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

.comparison-content strong {
    display: block;
    font-size: 1.2em;
    margin-bottom: 10px;
    color: #333;
}

.comparison-content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.5;
    max-width: 100%;
    box-sizing: border-box;
}

.comparison-content code {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    word-break: break-all;
    white-space: pre-wrap;
}

.comparison-content pre code {
    color: #f8f8f2;
    background: transparent;
    padding: 0;
}

.comparison-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    table-layout: fixed;
    box-sizing: border-box;
    font-size: 12px;
}

.comparison-table-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    margin: 20px 0;
    -webkit-overflow-scrolling: touch;
}

.comparison-table-wrapper table {
    min-width: 100%;
}

.comparison-table thead {
    background: #667eea;
    color: white;
}

.comparison-table th,
.comparison-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
    width: 33.33%;
}

.comparison-table th:first-child,
.comparison-table td:first-child {
    width: 30%;
}

.comparison-table th:nth-child(2),
.comparison-table td:nth-child(2) {
    width: 40%;
}

.comparison-table th:last-child,
.comparison-table td:last-child {
    width: 30%;
}

.comparison-table th {
    font-weight: 600;
    font-size: 14px;
}

.comparison-table tbody tr:hover {
    background: #f8f9fa;
}

.comparison-table tbody tr:last-child td {
    border-bottom: none;
}

.comparison-table td {
    font-size: 12px;
    color: #333;
    line-height: 1.5;
}



.response-card-content {
    margin-bottom: 15px;
}

.response-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #666;
    margin-top: 10px;
}

.empty-message {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-style: italic;
}


@media (max-width: 600px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-chatgpt {
        width: 100%;
    }
    
    .tab-button {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .tab-icon {
        font-size: 16px;
    }
    
    .tab-text {
        font-size: 14px;
    }
    
    .tested-responses-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .comparison-section {
        grid-template-columns: 1fr;
    }
    
}

/* Why Optimize Tab Styles */
.why-optimize-header {
    margin-bottom: 40px;
    text-align: center;
}

.why-optimize-header h2 {
    color: #333;
    font-size: 2em;
    margin-bottom: 15px;
}

.intro-text {
    font-size: 1.1em;
    color: #666;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
}

.benefits-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.benefit-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.benefit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.benefit-icon {
    font-size: 3em;
    margin-bottom: 15px;
    display: block;
}

.benefit-card h3 {
    color: #333;
    font-size: 1.4em;
    margin-bottom: 12px;
}

.benefit-card p {
    color: #666;
    line-height: 1.7;
    font-size: 15px;
}

.best-practices-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
}

.best-practices-section h2 {
    color: #333;
    font-size: 1.8em;
    margin-bottom: 25px;
    text-align: center;
}

.practice-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.practice-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #667eea;
}

.practice-item h4 {
    color: #667eea;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.practice-item p {
    color: #666;
    line-height: 1.8;
    margin: 0;
}

.resources-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 30px;
    color: white;
    text-align: center;
}

.resources-section h2 {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: white;
}

.resource-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.resource-link {
    background: white;
    color: #667eea;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-block;
    min-width: 300px;
}

.resource-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .benefits-container {
        grid-template-columns: 1fr;
    }
    
    .resource-link {
        min-width: 100%;
    }
}

