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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #ffffff;
    min-height: 100vh;
}

.header {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #0f3460, #16537e);
    border-bottom: 3px solid #007bff;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
}

.left-panel {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    border: 2px solid #007bff;
    max-height: 80vh;
    overflow-y: auto;
}

.right-panel {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    border: 2px solid #007bff;
    text-align: center;
}

.section {
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(0, 123, 255, 0.1);
    border-radius: 10px;
    border-left: 4px solid #007bff;
}

.section h3 {
    margin-bottom: 15px;
    color: #007bff;
    font-size: 1.1em;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    margin: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #1e7e34, #155724);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333, #a71e2a);
    transform: translateY(-2px);
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #138496, #0f6674);
    transform: translateY(-2px);
}

.btn-gender {
    background: rgba(0, 123, 255, 0.2);
    color: #007bff;
    border: 2px solid #007bff;
    margin: 5px;
    padding: 10px 15px;
}

.btn-gender.active {
    background: #007bff;
    color: white;
}

.btn-category {
    background: rgba(0, 123, 255, 0.2);
    color: #007bff;
    border: 2px solid #007bff;
    margin: 5px;
    padding: 8px 12px;
}

.btn-category.active {
    background: #007bff;
    color: white;
}

.btn-style {
    background: rgba(0, 123, 255, 0.2);
    color: #007bff;
    border: 2px solid #007bff;
    width: 40px;
    height: 40px;
    margin: 2px;
}

.btn-style.active {
    background: #007bff;
    color: white;
}

.upload-area {
    border: 2px dashed #007bff;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    background: rgba(0, 123, 255, 0.1);
    border-color: #0056b3;
}

.upload-area.dragover {
    background: rgba(0, 123, 255, 0.2);
    border-color: #0056b3;
}

.text-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.text-controls input,
.text-controls select {
    padding: 8px;
    border: 1px solid #007bff;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.text-controls input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.text-style-buttons {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.gallery-categories {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.gallery-grid,
.clipart-grid,
.emoticon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.gallery-item,
.clipart-item,
.emoticon-item {
    width: 60px;
    height: 60px;
    border: 2px solid #007bff;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 123, 255, 0.1);
}

.gallery-item:hover,
.clipart-item:hover,
.emoticon-item:hover {
    transform: scale(1.1);
    border-color: #0056b3;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.gallery-item img,
.clipart-item img,
.emoticon-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.canvas-container {
    background: white;
    border-radius: 10px;
    padding: 10px;
    margin: 20px 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#designCanvas {
    border: 2px solid #007bff;
    border-radius: 8px;
    cursor: crosshair;
    background: white;
}

.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.elements-list {
    max-height: 150px;
    overflow-y: auto;
}

.element-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    margin: 5px 0;
    background: rgba(0, 123, 255, 0.1);
    border-radius: 5px;
    border: 1px solid #007bff;
    cursor: pointer;
}

.element-item:hover {
    background: rgba(0, 123, 255, 0.2);
}

.element-item.selected {
    background: rgba(0, 123, 255, 0.3);
    border-color: #0056b3;
}

.element-controls {
    display: flex;
    gap: 5px;
}

.element-controls button {
    padding: 4px 8px;
    font-size: 12px;
}

.cart-area {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #007bff;
    border-radius: 8px;
    padding: 10px;
    background: rgba(0, 123, 255, 0.05);
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin: 5px 0;
    background: rgba(0, 123, 255, 0.1);
    border-radius: 5px;
    border: 1px solid #007bff;
}

.cart-item img {
    width: 50px;
    height: 50px;
    border-radius: 5px;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
    text-align: left;
}

.cart-item-info h4 {
    margin: 0;
    color: #007bff;
}

.cart-item-info p {
    margin: 2px 0;
    font-size: 0.9em;
    opacity: 0.8;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    margin: 5% auto;
    padding: 20px;
    border: 2px solid #007bff;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    color: white;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover {
    color: #007bff;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #007bff;
    font-weight: bold;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #007bff;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.payment-options {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.payment-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

#paymentFormContainer {
    border: 1px solid #007bff;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    background: rgba(0, 123, 255, 0.05);
}

#paymentFormContainer input {
    margin-bottom: 10px;
}

.order-item {
    border: 1px solid #007bff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    background: rgba(0, 123, 255, 0.05);
}

.order-item h4 {
    color: #007bff;
    margin-bottom: 10px;
}

.order-item img {
    max-width: 100px;
    max-height: 60px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.size-quantity {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 10px 0;
}

.size-quantity label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9em;
}

.size-quantity input {
    width: 50px;
    padding: 4px;
}

.total {
    text-align: center;
    font-size: 1.2em;
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 123, 255, 0.1);
    border-radius: 8px;
    border: 2px solid #007bff;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .left-panel {
        max-height: none;
    }
    
    .gallery-grid,
    .clipart-grid,
    .emoticon-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }
    
    .gallery-item,
    .clipart-item,
    .emoticon-item {
        width: 50px;
        height: 50px;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
    }
}

/* Selection styles for canvas elements */
.canvas-selection {
    position: absolute;
    border: 2px dashed #007bff;
    pointer-events: none;
}

.resize-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #007bff;
    border: 1px solid white;
    cursor: nw-resize;
}

.rotate-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #28a745;
    border: 1px solid white;
    border-radius: 50%;
    cursor: grab;
}

