/* Dev environment base styles */

/* Add these styles at the top of the file */
html, body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.controls {
    flex: 0 0 auto;
}

.preview {
    flex: 1 1 auto;
    min-height: 0;
    padding-bottom: 60px; /* Add space for footer */
    margin: 0;  /* Remove margin */
    padding: 0; /* Remove padding */
    position: relative;
    width: 100%; /* Changed to 100% to fill available space */
    max-width: 900px; /* Set max-width instead of fixed width */
}

.footer {
    flex-shrink: 0;
    margin-top: auto;
    /* position: fixed; 
    bottom: 0;
    left: 0;
    right: 0; */
    background: white;
    padding: 10px 20px;
    text-align: center;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
    /* z-index: 100; */
}

/* HACK: not sure why this is needed but it overrides what is in the plugins.css from 
the CDN and sizes the layout not to match the rendering on the server. 
*/
.trmnl .table tbody tr {
    height: 50px;
}

/* update title_bar class in view to have a gray dotted background */
.trmnl .title_bar.title_bar {
    background-image: url('/images/grayscale/gray-6.png');
    background-repeat: repeat;
    border-radius: 5px;

    
    position: absolute  !important;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px; /* Set a fixed height for the title bar */
    top: 430px !important;
    display: flex  !important;
    margin: 10px  !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f0f0f0;
}

/* Controls section */
.controls {
    margin-bottom: 20px;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Preview section */

.preview-frame {
    border: none;
    width: 800px;
    height: 480px;
    display: block;
    margin: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

/* Layout variations */
.full {
    transform: none;
}

.half-horizontal {
    height: 240px !important;  /* Half of 480px */
    width: 800px;
    max-height: 50%;  /* Ensure it never exceeds half height */
}

/* Also ensure the view inside half-vertical is constrained */
.half-vertical .view {
    width: 100% !important;
    max-width: 400px;
    margin: 0 auto;
}

.quadrant-quarter {
    width: 400px;
    height: 240px;
}

/* Size indicator */
.size-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 110;
}

/* Plugin container styles */
.plugin-container {
    margin-bottom: 2rem;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.plugin-container h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.error {
    color: #721c24;
    background-color: #f8d7da;
    padding: 1rem;
    border-radius: 4px;
}

.plugin-container-large {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 20px auto;
    padding: 20px;
    width: 800px;
    min-height: 480px;
}

/* Tooltip styles */
[data-tooltip]:after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    left: 0;
    transform: none;
    padding: 8px 12px;
    background: rgba(0,0,0,0.8);
    color: white;
    font-size: 12px;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    margin-top: 8px;
    z-index: 10000;
    max-width: 600px;
    white-space: normal;
    text-align: left;
    line-height: 1.4;
    word-wrap: break-word;
}

[data-tooltip]:hover:after {
    opacity: 1;
    visibility: visible;
}

/* Plugin info panel styles */
.json-header, .plugin-info-panel, .plugin-info-content {
    overflow: visible !important;
}

.url-button {
    position: relative !important;
    z-index: 2 !important;
}

.url-button[data-tooltip]:after {
    left: 0;
    right: auto;
    transform: none;
}

/* Empty state styles */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 40px auto;
    max-width: 600px;
}

.empty-state p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
}

.empty-state code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: #f8654b;
}

/* Plugin info styles */
.plugin-info {
    margin: 0 auto 20px;
    max-width: 800px;
    padding: 10px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    box-sizing: inherit;
}

/* Layout styles - keep at end of file */
.trmnl .screen {
    width: 100%;
    max-width: 800px;
    height: 480px;
    background: white;
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
    position: relative;
    border: 1px solid #ccc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

/* View should fill screen by default */
.trmnl .view {
    width: 100%;
    height: 100%;
}

/* Then override only what's needed for each layout */
.half-horizontal .view {
    height: 240px !important;
    overflow-y: auto;
}

.half-horizontal .layout {
    height: 240px !important;
}

.half-horizontal .screen {
    height: 240px !important;
}

.half-horizontal .table {
    max-height: 180px;
    overflow-y: auto;
}

.half-vertical .view {
    width: 400px !important;
}

.quadrant-quarter .view {
    width: 400px !important;
    height: 240px !important;
}

/* Title bar positioning */
.title_bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

/* Preview container and title */
.preview-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 16px;
    box-sizing: border-box;
    flex: 0 0 100%;
}

.preview-container h2 {
    margin: 0 0 10px 0;
    line-height: 1;
}

.preview-frame {
    width: 800px;
    height: 480px;
    margin: 0;
    display: block;
    border: none;
}

/* Plugin wrapper layout */
.preview-wrapper {
    display: flex;
    gap: 15px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    align-items: flex-start;
    padding: 10px;
    box-sizing: border-box;
}

/* Left side - preview */
.preview-container {
    flex: 0 0 100%;
    max-width: 900px;
    box-sizing: border-box;
}

/* Right side - plugin info */
.plugin-info-panel {
    flex: 1;
    min-width: 700px;
    max-width: 800px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 30px;    /* Added top margin */
}

/* Plugin info content */
.plugin-info-panel pre {
    white-space: pre-wrap;
    word-break: break-word;  /* Better word breaking */
    font-size: 13px;
    line-height: 1.4;
    margin: 0;  /* Remove default margins */
    width: 100%;  /* Take full width of container */
}

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

.json-header h3 {
    margin: 0;
}

/* Layout links section */
.layout-links, .layout-links h3 {
    margin-top: 0;
}

/* Or more specifically if needed */
.plugin-info-panel .layout-links {
    margin-top: 0;
}

.layout-buttons {
    display: flex;
    flex-direction: row;  /* Changed from column to row */
    gap: 8px;            /* Slightly larger gap for horizontal layout */
    flex-wrap: wrap;     /* Allow wrapping if needed */
}

/* Fix iframe body padding */
.trmnl.preview-frame {
    padding: 0;
    padding-bottom: 0;
    padding-top: 0;
    padding-left: 0;
    padding-right: 0;
    margin: 0;
}

/* Also ensure the body itself has no padding */
body.trmnl.preview-frame {
    padding: 0;
    padding-bottom: 0;
    padding-top: 0;
    padding-left: 0;
    padding-right: 0;
    margin: 0;
}

/* Button styles */
button {
    padding: 6px 12px;  /* Reduced padding */
    border: none;
    border-radius: 4px;
    background: #f8654b;
    color: white;
    font-size: 13px;    /* Reduced font size */
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

button:hover {
    background: #e54b2e;
}

.copy-button {
    width: auto;         /* Changed from 100% to auto */
    text-align: left;
    background: #f5f5f5;
    color: #333;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap; /* Prevent button text from wrapping */
}

.copy-button:hover {
    background: #e9e9e9;
}

.url-button {
    background: #28a745;
    color: white;
    margin-left: 10px;
    padding: 4px 8px;
    font-size: 12px;
}

.url-button:hover {
    background: #218838;
}

/* Controls heading */
.controls-heading {
    margin: 0;
    margin-left: auto;
    font-size: 18px;
    color: #666;
}

.controls-heading span {
    color: #f8654b;  /* TRMNL orange */
}

/* Select styles */
select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}

/* Screen and view layout */
.screen {
    position: relative;
    margin: 0 auto; /* Center the screen */
}

.view-frame {
    border: none;
    margin: 0;
    padding: 0;
}

/* Layout-specific view styles */
.view-frame.full {
    width: 800px;
    height: 480px;
}

.view-frame.half-horizontal {
    width: 800px;
    height: 240px;
}

.view-frame.half-vertical {
    width: 400px;
    height: 480px;
}

.view-frame.quadrant-quarter {
    width: 400px;
    height: 240px;
}

/* Style for view-only body (in iframe) */
body.view-only {
    margin: 0;
    padding: 0;
    width: 800px;
    height: 480px;
    overflow: hidden;
}

/* Make sure view is also white */
.view {
    background: white;
}

/* Toast notification styles */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    z-index: 1000;
    display: none;
    max-width: 400px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.toast.error {
    background-color: #f8654b;
    color: white;
    border-left: 4px solid #d32f2f;
}

.toast.success {
    background-color: #4caf50;
    color: white;
    border-left: 4px solid #2e7d32;
}

/* Add these styles for the welcome popup */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-popup {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 600px;
    text-align: center;
    z-index: 1001;
}

.welcome-popup h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.welcome-popup p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.welcome-popup a {
    color: #f8654b;
    text-decoration: none;
}

.welcome-popup button {
    background: #f8654b;
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1.5rem;
}


/* Add frame styling to mimic TRMNL device */
.preview-container {
    position: relative;
    padding: 40px;
    background: #f5f5f5;
    border-radius: 16px;
    box-shadow: 
        0 1px 3px rgba(0,0,0,0.12),
        0 1px 2px rgba(0,0,0,0.24),
        inset 0 0 0 1px rgba(255,255,255,0.5);
}

/* Add TRMNL logo at bottom */
.preview-container::after {
    content: "TRMNL";
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-family: sans-serif;
    color: #999;
    font-size: 12px;
    opacity: 0.5;
}

/* Add subtle inner shadow to simulate e-ink screen */
.screen {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

/* Add subtle texture */
.screen::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAUVBMVEWFhYWDg4N3d3dtbW17e3t1dXWBgYGHh4d5eXlzc3OLi4ubm5uVlZWPj4+NjY19fX2JiYl/f39ra2uRkZGZmZlpaWmXl5dvb29xcXGTk5NnZ2c8TV1mAAAAG3RSTlNAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAvEOwtAAAFVklEQVR4XpWWB67c2BUFb3g557T/hRo9/WUMZHlgr4Bg8Z4qQgQJlHI4A8SzFVrapvmTF9O7dmYRFZ60YiBhJRCgh1FYhiLAmdvX0CzTOpNE77ME0Zty/nWWzchDtiqrmQDeuv3powQ5ta2eN0FY0InkqDD73lT9c9lEzwUNqgFHs9VQce3TVClFCQrSTfOiYkVJQBmpbq2L6iZavPnAPcoU0dSw0SUTqz/GtrGuXfbyyBniKykOWQWGqwwMA7QiYAxi+IlPdqo+hYHnUt5ZPfnsHJyNiDtnpJyayNBkF6cWoYGAMY92U2hXHF/C1M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fw177G7j/OGbIs8TahLyynl4X4RinF793Oz+BU0saXtUHrVBFT/DnA3ctNPoGbs4hRIjTok8i+algT1lTHi4SxFvONKNrgQFAq2/gFnWMXgwffgYMJpiKYkmW3tTg3ZQ9Jq+f8XN+A5eeUKHWvJWJ2sgJ1Sop+wwhqFVijqWaJhwtD8MNlSBeWNNWTa5Z5kPZw5+LbVT99wqTdx29lMUH4OIG/D86ruKEauBjvH5xy6um/Sfj7ei6UUVk4AIl3MyD4MSSTOFgSwsH/QJWaQ5as7ZcmgBZkzjjU1UrQ74ci1gWBCSGHtuV1H2mhSnO3Wp/3fEV5a+4wz//6qy8JxjZsmxxy5+4w9CDNJY09T072iKG0EnOS0arEYgXqYnXcYHwjTtUNAcMelOd4xpkoqiTYICWFq0JSiPfPDQdnt+4/wuqcXY47QILbgAAAABJRU5ErkJggg==");
    opacity: 0.02;
    pointer-events: none;
}

/* Ensure iframe takes full screen size */
.preview iframe {
    width: 800px;
    height: 480px;
    border: none;
    margin: 0;
    padding: 0;
} 
