/* CSS Reset i Custom Properties */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Design Tokens 2025 */
    --primary-hue: 245;
    --secondary-hue: 320;
    --accent-hue: 160;
    
    /* Dynamic Colors using OKLCh with fallbacks */
    --primary-50: #f8faff;
    --primary-100: #e8f0ff;
    --primary-500: #667eea;
    --primary-600: #5a67d8;
    --primary-900: #2d3748;
    
    --accent-500: #4ecdc4;
    --accent-600: #44a08d;
    
    /* Semantic Colors */
    --surface: rgba(255, 255, 255, 0.95);
    --surface-variant: rgba(244, 246, 248, 0.95);
    --on-surface: #2d3748;
    --on-surface-variant: #718096;
    
    --success: #4caf50;
    --warning: #ff9800;
    --error: #f44336;
    
    /* Spacing Scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Typography Scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    
    /* Animation Tokens */
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 350ms;
    
    --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-elastic: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Border Radius Scale */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Base Styles - Iframe Safe */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--accent-500) 100%);
    color: var(--on-surface);
    height: 100vh;
    overflow: hidden; /* Iframe safe */
    line-height: 1.6;
    position: relative;
}

/* GIMP-Style Layout Container */
.app-container {
    display: grid;
    grid-template-areas: 
        "tools canvas gallery"
        "bottom-panel bottom-panel bottom-panel";
    grid-template-columns: 60px 1fr 0px; /* Gallery starts hidden */
    grid-template-rows: 1fr auto;
    height: 100vh;
    gap: 0;
    transition: grid-template-columns var(--duration-normal) var(--ease-out);
}

.app-container.gallery-open {
    grid-template-columns: 60px 1fr 20%;
}
.app-container.gallery-open .bottom-panel, .app-container.gallery-open .status-bar {
    transform: translateX(-10%); /* Połowa szerokości galerii */
    width: calc(100% + 5%); /* Kompensacja przesunięcia */
}
/* Status Bar - Fixed Top */
.status-bar {
    position: fixed;
    top: 0;
    left:60px;
    right: 0;
    background: var(--surface-variant);
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
    color: var(--on-surface-variant);
    z-index: 1000;
    backdrop-filter: blur(10px);
	display: flex;
	overflow:hidden;
	height: 60px;
    justify-content: center;
    transition: all 0.3s ease;
}

.status-bar.saved {
    color: var(--success);
    font-weight: 600;
}
.status-bar > div:not(:first-child) {
	
	padding-left: 10px;
	
}
.status-bar > div:not(:first-child)::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 60%;
  background-color: #ccc;
  margin:0 10px;
  place-content: center;
  
}
#status-bar {
	display: flex;
	align-items: center;
}
/* LEFT PANEL - TOOLS (GIMP Style) */
.tools-panel {
    grid-area: tools;
    background: var(--surface);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(0,0,0,0.1);
    padding: var(--space-md) var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    box-shadow: var(--shadow-md);
    z-index: 1001;
}

.tools-panel::-webkit-scrollbar {
    display: none;
}

.tool-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
	align-items: center;
}

.tool-group h4 {
    font-size: var(--text-xs);
    color: var(--on-surface-variant);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-xs);
    text-align: center;
}

.tool-btn {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--surface-variant);
    color: var(--on-surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    position: relative;
    overflow: hidden;
    /* -------------------- */
    /* nowy, wielowarstwowy cień: */
    box-shadow:
      0 2px 4px rgba(0, 0, 0, 0.1),   /* subtelny cień blisko przycisku */
      0 4px 8px rgba(0, 0, 0, 0.05);  /* delikatny blur dalej */
    transition:
      background var(--duration-normal) var(--ease-out),
      transform var(--duration-normal) var(--ease-out),
      box-shadow var(--duration-normal) var(--ease-out);
    /* -------------------- */
}


.tool-btn:hover {
    background: var(--primary-100);
    transform: translateY(-2px);
    /* -------------------- */
    /* większy, jaśniejszy, wielowarstwowy cień: */
    box-shadow:
      0 4px 8px rgba(0, 0, 0, 0.15),
      0 8px 16px rgba(0, 0, 0, 0.1),
      0 16px 24px rgba(0, 0, 0, 0.05);
    /* -------------------- */
}

.tool-btn.active,
.tool-btn:active {
    background: var(--primary-500);
    color: white;
    transform: translateY(0); /* przycisk “osiada” */
    /* -------------------- */
    /* dodajemy cień “inset” i bardzo subtelne zewnętrzne cienie: */
    box-shadow:
      inset 0 2px 4px rgba(0, 0, 0, 0.2),   /* wnęka wewnątrz przycisku */
      0 1px 2px rgba(0, 0, 0, 0.05),        /* bardzo subtelny cień zewnętrzny */
      0 2px 4px rgba(0, 0, 0, 0.02);
    /* -------------------- */
    transition:
      background var(--duration-normal) var(--ease-out),
      box-shadow var(--duration-normal) var(--ease-out);
}


.tool-btn.danger {
    background: var(--error);
    color: white;
}

.tool-btn.success {
    background: var(--success);
    color: white;
}

/* Gallery Button - Special Style */
.gallery-toggle-btn {
    background: var(--accent-500) !important;
    color: white !important;
}

.gallery-toggle-btn.active {
    background: var(--accent-600) !important;
}

/* Action counters */
.action-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--error);
    color: white;
    border-radius: var(--radius-full);
    width: 20px;
    height: 20px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid white;
    opacity: 0;
    transform: scale(0);
    transition: all var(--duration-normal) var(--ease-bounce);
}

.action-count.visible {
    opacity: 1;
    transform: scale(1);
}

/* RIGHT PANEL - GALLERY (Sliding) */
.gallery-panel {
    grid-area: gallery;
    background: var(--surface);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform var(--duration-normal) var(--ease-out);
    z-index: 200;
}

.gallery-panel.open {
    transform: translateX(0);
}

.gallery-header {
    padding: 0 var(--space-lg);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    background: var(--surface-variant);
    display: flex;
	    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
	margin-top: 60px;
}

.gallery-header h3 {
    font-size: var(--text-lg);
    color: var(--on-surface);
    font-weight: 600;
    display: flex;
	 flex: 1;
	 margin:0;
    align-items: center;
    gap: var(--space-sm);
}
.category-selector-wrapper {
    display: flex;
    align-items: center;
    min-width: 150px;
}

.category-selector {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    min-width: 150px;
    max-width: 200px;
    transition: all 0.2s ease;
}

.category-selector:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.category-selector:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}
.image-counter {
    background: var(--accent-500);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    min-width: 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.image-counter.updated {
    transform: scale(1.1);
    color: #667eea;
}
.image-counter.loading .counter-number::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 5px;
}

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

.refresh-btn {
    background: none;
    border: none;
    color: var(--on-surface-variant);
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: all var(--duration-fast) var(--ease-out);
}

.refresh-btn:hover {
    background: var(--surface-variant);
    color: var(--on-surface);
    transform: rotate(180deg);
}

.gallery-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8vw, 1fr));
    gap: var(--space-md);
}

.gallery-image {
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    background-size: cover;
    background-position: center;
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
    background-color: var(--surface-variant);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--on-surface-variant);
    font-size: var(--text-xs);
    text-align: center;
	box-shadow: 0 0 15px #00ffff59, 0 0 15px aqua inset;
    border: 3px solid cyan;
    mix-blend-mode: luminosity;
	}

.gallery-image:hover {
    transform: scale(1.05);
    border-color: var(--primary-500);
    box-shadow: var(--shadow-md);
}

.gallery-image.active {
    border-color: var(--accent-500);
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
    mix-blend-mode: initial;
}

/* MAIN CANVAS AREA */
.canvas-container {
	grid-area: canvas;
	background: aliceblue;
	/* border-radius: var(--radius-xl); */
	box-shadow: var(--shadow-xl);
	overflow: hidden;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: var(--space-sm);
	margin-top: 66px;
	margin-bottom: 66px;
}

.canvas-wrapper {
    position: relative;
   
    transform-origin: center center;
	background: white !important;
}

#background-canvas, 
#drawing-canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);


}
#background-canvas{
pointer-events: none;
	position: relative;	
}
#drawing-canvas {
    position: absolute;
    top: 0;
    left: 0;
    cursor: crosshair;
	cursor: none !important;
}
#drawing-canvas:hover {
        cursor: none !important;
}
#brush-cursor:not(.fill-mode){
    /*! box-shadow: 0 0 0 2px rgba(0,0,0,0.4); */ 
	position: fixed;
        pointer-events: none;
        border: 2px solid rgba(0,0,0,0.8);
        /*! border-radius: 50%; */
        z-index: 10000;
        display: none;
        
        transition: width 0.1s ease, height 0.1s ease, background-color 0.1s ease;
}

/* BOTTOM PANEL - COLORS & CONTROLS */
.bottom-panel {
	grid-area: bottom-panel;
	background: var(--surface);
	backdrop-filter: blur(20px);
	border-top: 1px solid rgba(0,0,0,0.1);
	padding: var(--space-sm) var(--space-md);
	display: block;
	box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
	z-index: 100;
	position: fixed;
	    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: left;
	bottom: 0;
	width: 100%;
	height: 60px;
	display: flex;
	place-content: center;
	align-items: center;
	z-index: 99;
}
/* Colors Section */
.colors-section {
    display: flex;
    /*! flex-direction: row; */
    /*! gap: var(--space-sm); */
    /*! width: 100%; */
    /*! display: contents; */
}

.colors-section h4 {
    font-size: var(--text-sm);
    color: var(--on-surface);
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.colors-grid {
    display: flex;
    /*! grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); */
    gap: var(--space-xs);
    width: 100%;
    justify-content: center;
    /*! align-items: center; */
    /*! align-content: center; */
    /*! place-content: center; */
}

.color {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    cursor: pointer;
    position: relative;
    z-index: 1;

    border: 3px solid #fff;
    box-shadow:
        inset 0 0 4px rgba(0, 0, 0, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.15),
        0 6px 12px rgba(0, 0, 0, 0.1);

    transition:
        transform var(--duration-normal) var(--ease-elastic),
        box-shadow var(--duration-normal) var(--ease-out);
}


.color:hover {
    transform: scale(1.1);
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.2),
        0 8px 12px rgba(0, 0, 0, 0.1),
        0 0 10px rgba(255, 255, 255, 0.2); /* efekt lekkiej poświaty */
}


.color.active {
    border-color: var(--on-surface);
    border-width: 4px;
    transform: scale(1.3) translateY(-4px);
    z-index: 9;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;

    box-shadow:
        inset 0 0 6px rgba(0, 0, 0, 0.5),
        0 6px 12px rgba(0, 0, 0, 0.25),
        0 12px 24px rgba(0, 0, 0, 0.15),
        0 0 12px rgba(255, 255, 255, 0.3); /* świetlista otoczka */
}


.color.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8),
                 0 0 4px rgba(255,255,255,0.4); /* dodatkowe rozświetlenie */
    pointer-events: none;
}


.history-color {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.history-color:hover {
    transform: scale(1.2);
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.history-color:active {
    transform: scale(0.95);
}
/* Brush Controls Section */
.brush-section {
	display: flex;
	flex-direction: row;
	gap: var(--space-sm);
	min-width: 200px;
	align-items: center;
}

.brush-section h4 {
    font-size: var(--text-sm);
    color: var(--on-surface);
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.brush-controls {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.slider-container label {
    font-size: var(--text-xs);
    color: var(--on-surface-variant);
    min-width: 60px;
    font-weight: 500;
}

.slider {
    flex: 1;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--on-surface-variant);
    outline: none;
    appearance: none;
    cursor: pointer;
    min-width: 100px;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background: var(--primary-500);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    border: 2px solid white;
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background: var(--primary-500);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    border: 2px solid white;
}

.brush-preview-mini {
	border-radius: var(--radius-md);
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
}
.brush-circle-mini {
	position: relative;
	border-radius: var(--radius-full);
	transition: all var(--duration-normal) var(--ease-out);
	/* domyślnie brak borderu — wszystko robi pseudoelement */
}

.brush-circle-mini::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: rgba(6, 24, 44, 0.4) 0px 0px 0px 2px, rgba(6, 24, 44, 0.65) 0px 4px 6px -1px, rgba(255, 255, 255, 0.08) 0px 1px 0px inset;
	pointer-events: none;
	z-index: 1;
}
/* Zoom Section */
.zoom-section {
	display: flex;
	flex-direction: row;
	gap: var(--space-sm);
	min-width: 120px;
	align-items: center;
}

.zoom-section h4 {
    font-size: var(--text-sm);
    color: var(--on-surface);
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.zoom-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-full);
    background: var(--primary-500);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-normal) var(--ease-out);
    font-size: 14px;
}

.zoom-btn:hover {
    background: var(--primary-600);
    transform: scale(1.1);
}

.zoom-level {
    font-weight: 600;
    color: var(--on-surface);
    font-size: var(--text-sm);
    min-width: 50px;
    text-align: center;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-out);
}

.modal-overlay.visible {
    opacity: 1;
}

.saved-state-modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    transform: scale(0.8) translateY(50px);
    transition: all var(--duration-normal) var(--ease-elastic);
}

.modal-overlay.visible .saved-state-modal {
    transform: scale(1) translateY(0);
}

/* Close button in modal */
.close-btn {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: none;
    border: none;
    font-size: var(--text-xl);
    color: var(--on-surface-variant);
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast) var(--ease-out);
}

.close-btn:hover {
    background: var(--surface-variant);
    color: var(--on-surface);
}

/* Modal content styles */
.modal-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.modal-header h2 {
    color: var(--on-surface);
    font-size: var(--text-2xl);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.modal-header p {
    color: var(--on-surface-variant);
    font-size: var(--text-base);
    line-height: 1.6;
}

.preview-container {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
    align-items: flex-start;
}

.preview-box {
    flex: 1;
    text-align: center;
}

.preview-box h3 {
    color: var(--on-surface);
    font-size: var(--text-lg);
    margin-bottom: var(--space-md);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.preview-image {
    width: 100%;
    max-width: 200px;
    height: 150px;
    border: 3px solid var(--surface-variant);
    border-radius: var(--radius-lg);
    object-fit: contain;
    background: var(--surface);
    margin: 0 auto;
    display: block;
}

.preview-image.saved {
    border-color: var(--success);
}

.preview-image.fresh {
    border-color: var(--primary-500);
}

.modal-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

.modal-btn {
    padding: var(--space-md) var(--space-xl);
    border: none;
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 140px;
    justify-content: center;
}

.modal-btn.primary {
    background: var(--success);
    color: white;
}

.modal-btn.secondary {
    background: var(--primary-500);
    color: white;
}

.modal-btn.tertiary {
    background: var(--surface-variant);
    color: var(--on-surface-variant);
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}


/* Desktop hiding mobile controls */
.mobile-controls {
    display: none;
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Focus states for accessibility */
.tool-btn:focus-visible,
.zoom-btn:focus-visible {
    outline: 2px solid var(--accent-500);
    outline-offset: 2px;
}

/* Iframe specific adjustments */
body.iframe-mode {
    background: var(--surface);
    border: 1px solid var(--surface-variant);
}
/* FULLSCREEN TOGGLE STYLES */
.fullscreen-toggle {
    position: fixed;
    top: 5px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.fullscreen-toggle:active {
    transform: scale(0.95);
}

.fullscreen-toggle i {
    transition: transform 0.3s ease;
}

.fullscreen-toggle.fullscreen-active i {
    transform: rotate(180deg);
}

.fullscreen-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9998 !important;
    background: white !important;
    overflow: auto !important;
}

.fullscreen-mode::-webkit-scrollbar {
    display: none;
}

.fullscreen-mode {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.fullscreen-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 15px 25px;
    border-radius: 25px;
    font-size: 16px;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.fullscreen-notification.show {
    opacity: 1;
    visibility: visible;
}

.fullscreen-notification i {
    margin-right: 10px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --surface: white;
        --on-surface: black;
        --primary-500: #0066cc;
        --accent-500: #cc6600;
    }
}



/* Print styles */
@media print {
    .tools-panel,
    .gallery-panel,
    .bottom-panel,
    .status-bar,
    .mobile-controls {
        display: none !important;
    }
    
    .app-container {
        grid-template-areas: "canvas";
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }
    
    .canvas-container {
        margin: 0;
        box-shadow: none;
        border-radius: 0;
    }
}
/* MOBILE RESPONSIVE */
@media (max-width: 768px) {
.app-container {
	grid-template-columns: 60px 1fr 0px;
}
   .tools-panel {
	padding: var(--space-xs) var(--space-xs);
	gap: var(--space-xs);
	box-shadow: var(--shadow-sm);

} 
    .status-bar {
		left:calc(60px + var(--space-xs));
        font-size: var(--text-xs);
        padding: var(--space-xs) var(--space-xs);
		
    }
.colors-section {
	display: flex;
	flex-direction: column;
	gap: var(--space-xs);
}
.colors-grid {
	gap: var(--space-sm);
	max-width: initial;
}
.bottom-panel {
	padding: var(--space-md);
	grid-template-columns: 1fr;
	gap: var(--space-xs);
}
.slider-container label {
	font-size: var(--text-xs);
	min-width: 30px;
	text-align: right;
}
    .canvas-container {
        margin: var(--space-xs);
        margin-top: 40px;
    }
    
    
    .mobile-toolbar {
        display: flex;
        justify-content: space-around;
        align-items: center;
        gap: var(--space-xs);
    }

 .tool-group {
	gap: var(--space-xs);
}   
    .tool-btn {
        width: 40px;
        height: 40px;
        border: none;
        border-radius: var(--radius-lg);
        background: var(--surface-variant);
        color: var(--on-surface);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        transition: all var(--duration-normal) var(--ease-out);
    }
    
    .tool-btn:hover {
        background: var(--primary-100);
    }
    
    .tool-btn.active {
        background: var(--primary-500);
        color: white;
    }
	    .fullscreen-toggle {
        width: 45px;
        height: 45px;
        font-size: 16px;
        top: 15px;
        right: 15px;
    }
	.bottom-panel {

	padding: var(--space-sm) var(--space-md);
	display: block;
}
}
@page {
    size: landscape;  
    margin: 0.5in;
}

@media print {
    * {
        print-color-adjust: exact !important; 
    }
}