/* General Body and Main Container Styles */
 body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f7f9fc;
    color: #334e68;
    height: 100vh;
    display: flex;
    flex-direction: column;
}
html {
    font-size: 65%;
}

/* Tool Page Layout */
.tool-header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 1.5rem 0;
}
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tool-header h1 a {
    color: #3b82f6;
    text-decoration: none;
    font-size: 1.6rem;
    font-weight: 800;
}
.tool-header nav {
    display: flex;
    gap: 1rem;
}
.tool-header nav a {
    color: #4b5563;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}
.tool-header nav a:hover {
    color: #3b82f6;
}

/* Tool Main Content */
.tool-main {
    flex-grow: 1; 
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
    box-sizing: border-box;
}

/* Sections */
.input-section, .preview-section {
    background-color: #fff;
    border: 1px solid #d1d5db; 
    border-radius: 12px; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05); 
    display: flex;
    flex-direction: column;
}

/* Section Headers */
.input-header, .preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb; 
    background-color: #f9fafb; 
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}
.input-header h3, .preview-header h3 {
    font-size: 1rem;
    color: #4b5563; 
    margin: 0;
    font-weight: 600;
    text-transform: uppercase;
}
.input-actions, .preview-actions {
    display: flex;
    gap: 8px;
}

/* Textarea */
#htmlInput {
    flex-grow: 1; 
    border: none;
    padding: 20px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.5;
    background: #fff;
    resize: none;
    outline: none;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}
#htmlInput::placeholder {
    color: #a0a0a0;
}

/* Preview Section */
.preview-container {
    position: relative;
    flex-grow: 1;
    overflow: auto;
    background: #fff;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}
#previewFrame {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
    display: block;
}

/* Placeholder Styles */
.preview-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    text-align: center;
    border-radius: 12px;
}
.placeholder-content {
    color: #666;
}
.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}
.placeholder-content h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
}
.placeholder-content p {
    margin: 0.25rem 0;
}
.placeholder-note {
    font-size: 0.9rem;
    color: #999 !important;
    font-style: italic;
}

/* Buttons */
.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}
.btn-secondary {
    background: #e5e7eb;
    color: #4b5563;
}
.btn-secondary:hover {
    background: #d1d5db;
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Fullscreen Modal Styles */
.fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}
.fullscreen-content {
    width: 95vw;
    height: 95vh;
    background: white;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    padding: 2rem;
    box-sizing: border-box;
}
.fullscreen-header {
    padding: 1rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}
.fullscreen-close {
    background: #ef4444; 
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}
.fullscreen-close:hover {
    background: #dc2626;
}
.fullscreen-frame {
    width: 100%;
    height: calc(100% - 60px);
    border: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }
    .tool-main {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px;
    }
    .input-section, .preview-section {
        min-height: 45vh;
    }
    .input-header, .preview-header {
        padding: 10px;
    }
    #htmlInput {
        padding: 10px;
        font-size: 12px;
    }
}