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

body {
    font-family: Arial, sans-serif;
    background: url('../images/background .jpg') center/cover no-repeat fixed;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #1a1a1a;
    font-size: 2em;
}

.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.image-box {
    width: 100%;
    height: 500px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    border: 2px dashed #dee2e6;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: opacity 0.3s;
}
.upload-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

#imageInput {
    display: none;
}

.upload-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    cursor: pointer;
    padding: 40px;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: all 0.3s;
}

.upload-btn i {
    font-size: 4em;
    color: #4CAF50;
}

.upload-btn:hover {
    background-color: #e9ecef;
}
.tools-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 800px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.tools-row {
    display: flex;
    justify-content: center;
    gap: 15px;
}
.top-tools, .bottom-tools {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    width: 100%;
}
.tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.tool-btn i {
    font-size: 1.8em;
    color: #4CAF50;
}
.tool-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.25);
    background: rgba(255, 255, 255, 0.25);
}
.download-btn {
    color: #333;
}
.download-btn:hover {
    background-color: rgba(76, 175, 80, 0.1);
}
.info-panel {
    width: 100%;
    max-width: 800px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    font-size: 0.9em;
    color: #666;
}
.crop-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.crop-dialog.show {
    display: flex;
}
.crop-dialog-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 300px;
}
.crop-dialog h3 {
    margin-bottom: 20px;
    text-align: center;
    color: #333;
}
.crop-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}
.input-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.input-group label {
    flex: 1;
    color: #666;
}
.input-group input {
    flex: 2;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100px;
}
.crop-dialog-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.crop-dialog-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}
.crop-dialog-buttons button:first-child {
    background-color: #4CAF50;
    color: white;
}
.crop-dialog-buttons button:last-child {
    background-color: #f5f5f5;
    color: #333;
}
.crop-dialog-buttons button:hover {
    opacity: 0.9;
}
.merge-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.merge-dialog.show {
    display: flex;
}
.merge-dialog-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 300px;
}
.merge-dialog h3 {
    margin-bottom: 20px;
    text-align: center;
    color: #333;
}
.merge-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}
.merge-inputs select {
    flex: 2;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
    background-color: white;
}
.merge-dialog-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.merge-dialog-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}
.merge-dialog-buttons button:first-child {
    background-color: #4CAF50;
    color: white;
}
.merge-dialog-buttons button:last-child {
    background-color: #f5f5f5;
    color: #333;
}
.merge-dialog-buttons button:hover {
    opacity: 0.9;
}