/* main.css - Core styles for PrintMyPoster2 */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --background-color: #f8fafc;
    --panel-background: #ffffff;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
    --success-color: #22c55e;
    --error-color: #ef4444;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--background-color);
}


header h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.panel {
    background-color: var(--panel-background);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.panel h2 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

/* Drop Zone Styles */
.drop-zone {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: border-color 0.3s ease;
}

.drop-zone:hover {
    border-color: var(--primary-color);
}

.drop-zone.drag-over {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
}

.drop-zone-content {
    pointer-events: none;
}

#file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Button Styles */
button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
    pointer-events: auto;
}

button:hover {
    background-color: var(--primary-hover);
}

button:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-group label {
    font-weight: 500;
}

/* Input Styles */
input[type="number"],
input[type="range"],
select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
}

input[type="range"] {
    width: 100%;
}

.radio-group {
    display: flex;
    gap: 1rem;
}

.size-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.unit {
    margin-left: 0.25rem;
    color: #64748b;
}

/* Image Preview */
#image-preview {
    margin-top: 2rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    padding: 0;
    background-color: #f8f9fa;
    border-radius: 8px;
}

#image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 0.375rem;
}

#fabric-canvas {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 10;
    pointer-events: auto;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

#preview-img {
    display: block;
    position: relative;
    z-index: 1;
}

.hidden {
    display: none !important;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Info Text */
.info-text {
    font-size: 0.875rem;
    color: #64748b;
}



/* Responsive Design */
@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .size-inputs {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }
}

/* Sheet Preview */
.sheet-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: #f5f5f5;
    border-radius: 4px;
    text-align: center;
    max-width: 100%;
    overflow: auto;
}

.sheet-preview canvas {
    max-width: 100%;
    height: auto;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    margin: 0 auto;
}

.sheet-grid {
    display: grid;
    gap: 4px;
    margin-bottom: 1rem;
}

.sheet-placeholder {
    aspect-ratio: 8.5/11; /* Letter size aspect ratio */
    background: #fff;
    border: 1px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #666;
}

.aspect-ratio-warning {
    margin-top: 1rem;
    padding: 0.5rem;
    background: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Loading message styles */
.loading-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    z-index: 1000;
}
