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

body {
    font-family: Arial, sans-serif;
    background: #f0f0f0;
    overflow: hidden;
}

.navbar {
    min-height: 56px;
    padding: 0.5rem 1rem;
}

.navbar-brand {
    font-weight: 600;
    color: #fff !important;
}

.toolbar-items {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
}

.collage-area {
    position: relative;
    width: 100vw;
    height: 100vh;
    padding-top: 56px;
    background: white;
    overflow: hidden;
}

.collage-area.grid-tiny {
    background-image: 
        linear-gradient(to right, #e0e0e0 1px, transparent 1px),
        linear-gradient(to bottom, #e0e0e0 1px, transparent 1px);
    background-size: 5px 5px;
}

.collage-area.grid-small {
    background-image: 
        linear-gradient(to right, #e0e0e0 1px, transparent 1px),
        linear-gradient(to bottom, #e0e0e0 1px, transparent 1px);
    background-size: 10px 10px;
}

.collage-area.grid-medium {
    background-image: 
        linear-gradient(to right, #e0e0e0 1px, transparent 1px),
        linear-gradient(to bottom, #e0e0e0 1px, transparent 1px);
    background-size: 20px 20px;
}

.collage-area.grid-large {
    background-image: 
        linear-gradient(to right, #e0e0e0 1px, transparent 1px),
        linear-gradient(to bottom, #e0e0e0 1px, transparent 1px);
    background-size: 40px 40px;
}

.collage-area.grid-xlarge {
    background-image: 
        linear-gradient(to right, #e0e0e0 1px, transparent 1px),
        linear-gradient(to bottom, #e0e0e0 1px, transparent 1px);
    background-size: 60px 60px;
}

.collage-area.grid-xxlarge {
    background-image: 
        linear-gradient(to right, #e0e0e0 1px, transparent 1px),
        linear-gradient(to bottom, #e0e0e0 1px, transparent 1px);
    background-size: 80px 80px;
}

.collage-area.grid-letter {
    background-image: 
        linear-gradient(to right, #b0b0b0 1px, transparent 1px),
        linear-gradient(to bottom, #b0b0b0 1px, transparent 1px),
        linear-gradient(to right, transparent 95px, #e0e0e0 95px, #e0e0e0 96px, transparent 96px, transparent 721px, #e0e0e0 721px, #e0e0e0 722px, transparent 722px),
        linear-gradient(to bottom, transparent 95px, #e0e0e0 95px, #e0e0e0 96px, transparent 96px, transparent 961px, #e0e0e0 961px, #e0e0e0 962px, transparent 962px);
    background-size: 816px 1056px;
    background-position: center;
}

.collage-area.grid-letter::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 816px;
    height: 1056px;
    border: 1px #a0a0a0;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

.photo-card {
    position: absolute;
    cursor: move;
    border: 2px solid transparent;
    transition: border-color 0.2s;
    user-select: none;
}

.photo-card:hover {
    border-color: #007bff;
}

.photo-card.selected {
    border-color: #ff4444;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #007bff;
    border-radius: 2px;
    z-index: 10;
}

.resize-handle.nw {
    top: -5px;
    left: -5px;
    cursor: nw-resize;
}

.resize-handle.ne {
    top: -5px;
    right: -5px;
    cursor: ne-resize;
}

.resize-handle.sw {
    bottom: -5px;
    left: -5px;
    cursor: sw-resize;
}

.resize-handle.se {
    bottom: -5px;
    right: -5px;
    cursor: se-resize;
}

.photo-card.selected .resize-handle {
    background: #ff4444;
}

.delete-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 20px;
    height: 20px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: none;
    line-height: 1;
    z-index: 20;
}

.photo-card.selected .delete-btn {
    display: block;
}

.form-control-color {
    width: 32px !important;
    height: 32px !important;
    padding: 2px;
    border-radius: 4px;
}

@media (max-width: 1200px) {
    .toolbar-items {
        gap: 6px;
    }
    
    .toolbar-items .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
}

@media (max-width: 992px) {
    .navbar {
        padding: 0.25rem 0.5rem;
    }
    
    .toolbar-items {
        gap: 4px;
        flex-wrap: wrap;
    }
    
    .toolbar-items input[type="file"] {
        width: 150px !important;
    }
    
    .toolbar-items select {
        width: 90px !important;
    }
    
    .navbar-brand {
        display: none;
    }
    
    .vr {
        display: none;
    }
}