body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1e1e1e;
    color: #e0e0e0;
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100%;
    width: 100%;
}

.sidebar {
    width: 320px;
    min-width: 320px;
    background-color: #252526;
    border-right: 1px solid #333;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
    z-index: 10;
    height: 100vh;
    box-sizing: border-box;
}

.canvas-wrapper {
    flex-grow: 1;
    position: relative;
    background-color: #1e1e1e;
    overflow: hidden;
    cursor: grab;
}

.canvas-wrapper:active {
    cursor: grabbing;
}

canvas {
    display: block;
}

h1 {
    margin: 0 0 10px 0;
    font-size: 1.4em;
}

h3 {
    margin: 0 0 10px 0;
    font-size: 1em;
    color: #aaa;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

.gear-list {
    flex-grow: 1;
    background: #2d2d2d;
    border-radius: 6px;
    padding: 10px;
    overflow-y: auto;
    min-height: 150px;
    max-height: 40vh;
}

.gear-item {
    padding: 8px;
    background: #3c3c3c;
    margin-bottom: 5px;
    border-radius: 4px;
    cursor: pointer;
    border-left: 3px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gear-item:hover {
    background: #4e4e52;
}

.gear-item.selected {
    background: #37373d;
    border-left-color: #007acc;
}

.control-group {
    background: #2d2d2d;
    padding: 12px;
    border-radius: 6px;
    flex-shrink: 0;
}

.properties-panel {
    background: #2d2d2d;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #444;
    flex-shrink: 0;
}

label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9em;
}

input[type="number"] {
    width: 60px;
    background: #3c3c3c;
    border: 1px solid #555;
    color: white;
    padding: 4px;
    border-radius: 3px;
    text-align: right;
}

input[type="text"],
select {
    width: 100px;
    background: #3c3c3c;
    border: 1px solid #555;
    color: white;
    padding: 4px;
    border-radius: 3px;
}

input[type="color"] {
    width: 40px;
    height: 25px;
    border: none;
    padding: 0;
    background: none;
}

button {
    width: 100%;
    background-color: #007acc;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 5px;
}

button:hover {
    background-color: #005f9e;
}

button.secondary {
    background-color: #3e3e42;
}

button.secondary:hover {
    background-color: #4e4e52;
}

.danger {
    background-color: #d32f2f;
}

.danger:hover {
    background-color: #b71c1c;
}

.separator {
    height: 1px;
    background: #444;
    margin: 10px 0;
}

.overlay-info {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    pointer-events: none;
    color: #aaa;
}

.empty-state {
    color: #888;
    text-align: center;
    margin-top: 20px;
    font-style: italic;
}

#view3d {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    background: #333;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 0.9em;
    color: #ccc;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.gear-list {
    flex-grow: 1;
    background: #2d2d2d;
    border-radius: 6px;
    padding: 10px;
    overflow-y: auto;
    min-height: 150px;
    max-height: 40vh;
}

.gear-item {
    padding: 8px;
    background: #3c3c3c;
    margin-bottom: 5px;
    border-radius: 4px;
    cursor: pointer;
    border-left: 3px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gear-item:hover {
    background: #4e4e52;
}

.gear-item.selected {
    background: #37373d;
    border-left-color: #007acc;
}

.control-group {
    background: #2d2d2d;
    padding: 12px;
    border-radius: 6px;
    flex-shrink: 0;
}

.properties-panel {
    background: #2d2d2d;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #444;
    flex-shrink: 0;
}

label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9em;
}

input[type="number"] {
    width: 60px;
    background: #3c3c3c;
    border: 1px solid #555;
    color: white;
    padding: 4px;
    border-radius: 3px;
    text-align: right;
}

input[type="text"],
select {
    width: 100px;
    background: #3c3c3c;
    border: 1px solid #555;
    color: white;
    padding: 4px;
    border-radius: 3px;
}

input[type="color"] {
    width: 40px;
    height: 25px;
    border: none;
    padding: 0;
    background: none;
}

button {
    width: 100%;
    background-color: #007acc;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 5px;
}

button:hover {
    background-color: #005f9e;
}

button.secondary {
    background-color: #3e3e42;
}

button.secondary:hover {
    background-color: #4e4e52;
}

.danger {
    background-color: #d32f2f;
}

.danger:hover {
    background-color: #b71c1c;
}

.separator {
    height: 1px;
    background: #444;
    margin: 10px 0;
}

.overlay-info {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    pointer-events: none;
    color: #aaa;
}

.empty-state {
    color: #888;
    text-align: center;
    margin-top: 20px;
    font-style: italic;
}

#view3d {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    background: #333;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 0.9em;
    color: #ccc;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #007acc;
}

input:checked+.slider:before {
    transform: translateX(26px);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    display: none;
    /* Hidden by default */
}

.modal-content {
    background: #2d2d2d;
    padding: 30px;
    border-radius: 8px;
    width: 500px;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
}

.pricing-options {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    gap: 10px;
}

.pricing-card {
    background: #3c3c3c;
    padding: 15px;
    border-radius: 6px;
    flex: 1;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.pricing-card:hover {
    background: #4e4e52;
}

.pricing-card.selected {
    border-color: #007acc;
    background: #37373d;
}

.price {
    font-size: 1.5em;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 5px;
}

button:hover {
    background-color: #005f9e;
}

button.secondary {
    background-color: #3e3e42;
}

button.secondary:hover {
    background-color: #4e4e52;
}

.danger {
    background-color: #d32f2f;
}

.danger:hover {
    background-color: #b71c1c;
}

.separator {
    height: 1px;
    background: #444;
    margin: 10px 0;
}

.overlay-info {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    pointer-events: none;
    color: #aaa;
}

.empty-state {
    color: #888;
    text-align: center;
    margin-top: 20px;
    font-style: italic;
}

#view3d {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    background: #333;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 0.9em;
    color: #ccc;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #007acc;
}

input:checked+.slider:before {
    transform: translateX(26px);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    display: none;
    /* Hidden by default */
}

.modal-content {
    background: #2d2d2d;
    padding: 30px;
    border-radius: 8px;
    width: 500px;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
}

.pricing-options {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    gap: 10px;
}

.pricing-card {
    background: #3c3c3c;
    padding: 15px;
    border-radius: 6px;
    flex: 1;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.pricing-card:hover {
    background: #4e4e52;
}

.pricing-card.selected {
    border-color: #007acc;
    background: #37373d;
}

.price {
    font-size: 1.5em;
    font-weight: bold;
    color: #fff;
    margin: 10px 0;
}

.duration {
    color: #aaa;
    font-size: 0.9em;
}

#paypal-button-container {
    margin-top: 20px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        max-height: 45vh;
        border-right: none;
        border-bottom: 1px solid #333;
        padding: 10px;
    }

    .canvas-wrapper {
        height: 55vh;
        /* Remaining height */
    }

    .gear-list {
        min-height: 80px;
        max-height: 150px;
    }

    h1 {
        font-size: 1.2em;
        text-align: center;
    }

    .control-group {
        padding: 8px;
    }

    .toolbar {
        display: flex;
        gap: 5px;
    }
}

/* END Mobile Responsiveness */

/* Legal Pages */
.legal-page {
    background-color: #1a1a1a;
    color: #e0e0e0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.legal-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 40px;
    background: #2d2d2d;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.legal-container h1 {
    color: #ffffff;
    border-bottom: 2px solid #007acc;
    padding-bottom: 10px;
}

.legal-container h2 {
    color: #007acc;
    margin-top: 30px;
}

.legal-container ul {
    margin-left: 20px;
}

.footer-links {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #444;
    text-align: center;
}

.footer-links a {
    color: #aaa;
    text-decoration: none;
    margin: 0 10px;
    font-size: 0.9em;
}

.footer-links a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: 20px;
    font-size: 0.7em;
    color: #666;
    text-align: center;
}

.sidebar-footer a {
    color: #888;
    text-decoration: none;
}

.sidebar-footer a:hover {
    color: #bbb;
}

/* Auth Pages */
.auth-container {
    width: 100%;
    max-width: 400px;
    margin: 60px auto;
    padding: 30px;
    background: #2d2d2d;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
}

@media (max-width: 480px) {
    .auth-container {
        margin: 20px auto;
        padding: 20px;
        width: 90%;
    }
}

.error {
    color: #ff6b6b;
    font-size: 0.9em;
    margin-bottom: 10px;
    background: rgba(255, 107, 107, 0.1);
    padding: 10px;
    border-left: 3px solid #ff6b6b;
}

.success {
    color: #51cf66;
    font-size: 0.9em;
    margin-bottom: 10px;
    background: rgba(81, 207, 102, 0.1);
    padding: 10px;
    border-left: 3px solid #51cf66;
}

input {
    width: 100%;
    margin-bottom: 15px;
    box-sizing: border-box;
    padding: 10px;
    background: #3c3c3c;
    border: 1px solid #555;
    color: white;
    border-radius: 4px;
}

input:focus {
    border-color: #007acc;
    outline: none;
}