/* Base styles */
body {
   font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
   margin: 0;
   padding: 20px;
   background-color: #f0f2f5;
   min-height: 100vh;
}

.layout-container {
   max-width: 1200px;
   margin: 0 auto;
   display: grid;
   grid-template-columns: 280px 1fr;
   gap: 24px;
   align-items: start;
}

/* Sidebar */
.sidebar {
   display: flex;
   flex-direction: column;
   gap: 20px;
   position: sticky;
   top: 20px;
}

/* Menu Styles */
.menu {
   background: white;
   padding: 24px;
   border-radius: 12px;
   box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.menu-item {
   padding: 12px 16px;
   margin-bottom: 8px;
   border-radius: 8px;
   cursor: pointer;
   transition: all 0.2s ease;
   font-weight: 500;
}

.menu-item:hover {
   transform: translateX(4px);
}

.menu-item.with-submenu {
   margin-bottom: 0;
   padding: 0;
}

.menu-header {
   padding: 12px 16px;
   cursor: pointer;
   display: flex;
   align-items: center;
   justify-content: space-between;
   transition: all 0.2s ease;
}

.menu-header::after {
   content: '›';
   transition: transform 0.3s ease;
   font-size: 20px;
   line-height: 1;
}

.menu-header.open::after {
   transform: rotate(90deg);
}

.submenu {
   display: none;
   padding-left: 16px;
   margin-top: 4px;
}

.submenu.open {
   display: block;
}

.submenu .menu-item {
   padding: 8px 16px;
   font-size: 0.95em;
   margin-bottom: 4px;
}

.menu-item.with-submenu.active > .menu-header {
   background-color: #e5e7eb;
   border-radius: 8px;
}

.submenu .menu-item.active {
   background-color: #1e3a8a;
   color: white;
}

/* Controls */
.side-controls {
   background: white;
   padding: 20px;
   border-radius: 12px;
   box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.control-group {
   margin-bottom: 16px;
}

.control-group:last-child {
   margin-bottom: 0;
}

.control-group label {
   display: block;
   margin-bottom: 8px;
   font-weight: 500;
   color: #4b5563;
}

.language-select,
.build-select {
   width: 100%;
   padding: 8px 12px;
   border: 1px solid #e5e7eb;
   border-radius: 6px;
   font-size: 14px;
   appearance: none;
   background-color: white;
   background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
   background-repeat: no-repeat;
   background-position: right 12px center;
   background-size: 12px;
}

/* Main Content */
.main-content {
   display: flex;
   flex-direction: column;
   gap: 20px;
}

/* Image Container */
.image-container {
   background: lightslategray;
   padding: 20px;
   border-radius: 12px;
   box-shadow: 0 2px 8px rgba(0,0,0,0.05);
   display: flex;
   justify-content: center;
}

.image-preview {
   max-width: 100%;
   height: auto;
   border-radius: 8px;
   box-shadow: rgba(0, 0, 0, 0.1) 0px 10px 50px;
}

/* Theme Toggle */
.theme-toggle {
   position: fixed;
   top: 20px;
   right: 20px;
   background: white;
   border: none;
   cursor: pointer;
   padding: 10px;
   border-radius: 50%;
   box-shadow: 0 2px 8px rgba(0,0,0,0.1);
   z-index: 1000;
   height: 44px;
}

/* Dark Mode */
body.dark-mode {
   background-color: #1a1a1a;
   color: white;
}

body.dark-mode .menu,
body.dark-mode .image-container,
body.dark-mode .side-controls,
body.dark-mode .theme-toggle {
   background: #2d2d2d;
   color: white;
}

body.dark-mode .language-select,
body.dark-mode .build-select {
   background-color: #2d2d2d;
   border-color: #404040;
   color: white;
}

body.dark-mode .menu-item {
   color: #e5e7eb;
}

body.dark-mode .submenu .menu-item.active {
   background-color: #3b82f6;
}

body.dark-mode .menu-header::after {
   color: #e5e7eb;
}

body.dark-mode .control-group label {
   color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 1024px) {
   .layout-container {
       grid-template-columns: 250px 1fr;
       gap: 20px;
   }
}

@media (max-width: 768px) {
   body {
       padding: 16px;
   }
   
   .layout-container {
       grid-template-columns: 1fr;
   }

   .sidebar {
       position: static;
   }
}

@media (max-width: 480px) {
   body {
       padding: 16px;
   }

   .menu, 
   .side-controls {
       padding: 16px;
   }
}

body.dark-mode .menu-item.with-submenu.active > .menu-header {
    background-color: #374151;
    color: #e5e7eb;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0 0;
    color: #1e3a8a;
}

.control-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 8px 0 0 0;
    color: #1e3a8a;
}

body.dark-mode .section-title,
body.dark-mode .control-title {
    color: #60a5fa;
}