.hidden {
    display: none !important;
}

.main-content {
    padding: 40px 20px;
    transition: all 0.3s ease;
}

.site-container {
    max-width: 1200px;
    margin: 0 auto;
}

.editor-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    align-items: start;
    margin-top: 30px;
}

.preview-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Header within preview card */
.preview-header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.file-info h3 {
    font-size: 1.1rem;
    color: #1e293b;
    font-weight: 700;
}

.stats-container {
    display: flex;
    gap: 20px;
}

.stat-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
}

/* Crop Area */
.crop-container {
    background: #f1f5f9;
    border-radius: 16px;
    padding: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
    position: relative;
    overflow: hidden;
}

.crop-wrapper {
    position: relative;
    display: inline-block;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

#image-to-crop {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    user-select: none;
    pointer-events: none;
    transition: transform 0.3s ease;
}

.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.crop-box {
    position: absolute;
    border: 2px solid #3b82f6;
    box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.5);
    cursor: move;
    z-index: 10;
}

/* Handles */
.handle {
    width: 14px;
    height: 14px;
    background: #3b82f6;
    border: 2px solid #fff;
    position: absolute;
}

.handle.nw {
    top: -7px;
    left: -7px;
    cursor: nw-resize;
}

.handle.ne {
    top: -7px;
    right: -7px;
    cursor: ne-resize;
}

.handle.sw {
    bottom: -7px;
    left: -7px;
    cursor: sw-resize;
}

.handle.se {
    bottom: -7px;
    right: -7px;
    cursor: se-resize;
}

/* Grid lines */
.crop-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.grid-line {
    position: absolute;
    background: rgba(255, 255, 255, 0.4);
}

.line-v1 {
    left: 33.33%;
    top: 0;
    width: 1px;
    height: 100%;
}

.line-v2 {
    left: 66.66%;
    top: 0;
    width: 1px;
    height: 100%;
}

.line-h1 {
    top: 33.33%;
    left: 0;
    height: 1px;
    width: 100%;
}

.line-h2 {
    top: 66.66%;
    left: 0;
    height: 1px;
    width: 100%;
}

/* Editor Toolbar */
.editor-toolbar {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.tool-btn {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-btn:hover {
    background: #eff6ff;
    color: #3b82f6;
    border-color: #3b82f6;
    transform: translateY(-2px);
}

/* Zoom Controls */
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 15px;
    color: #64748b;
}

.zoom-controls input[type="range"] {
    width: 150px;
    accent-color: #3b82f6;
    cursor: pointer;
}

#zoom-level {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    min-width: 45px;
}

.tool-divider {
    width: 1px;
    height: 30px;
    background: #e2e8f0;
    margin: 0 10px;
}

/* Sidebar Sections */
.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.control-section h3 {
    font-size: 0.85rem;
    margin-bottom: 15px;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Filters Styling */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-item label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

.filter-item input[type="range"] {
    width: 100%;
    accent-color: #3b82f6;
    cursor: pointer;
}

.grayscale-toggle {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
}

.grayscale-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Aspect Ratio Enhancements */
.platform-selector {
    margin-bottom: 15px;
}

.custom-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #1e293b;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    transition: all 0.2s;
}

.custom-select:focus {
    border-color: #3b82f6;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.presets-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 5px;
    margin-top: 10px;
}

.presets-grid::-webkit-scrollbar {
    width: 4px;
}

.presets-grid::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.preset-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.preset-card:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: translateY(-2px);
}

.preset-card.active {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.preset-thumb {
    width: 60px;
    height: 60px;
    background: #e2e8f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border: 1px solid #cbd5e1;
}

/* Visual Aspect Ratio Box in Thumbnail */
.ratio-box {
    background: #3b82f6;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.preset-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #1e293b;
}

.preset-dims {
    font-size: 0.65rem;
    color: #64748b;
}

/* Remove old ratio-grid styles if they were there */
.ratio-grid {
    display: none;
}

/* Custom Size Inputs */
.size-inputs {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.input-group {
    flex: 1;
}

.input-group label {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 5px;
}

.input-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: #3b82f6;
}

.link-icon {
    padding-bottom: 12px;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.link-icon i.active {
    color: #3b82f6;
}

/* Buttons */
.footer-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
}

.primary-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.primary-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.secondary-btn {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 14px;
    border-radius: 12px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: #f8fafc;
    color: #1e293b;
}

/* Upload Section Enhancement */
.upload-section {
    max-width: 600px;
    margin: 40px auto;
}

.upload-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 2px dashed #cbd5e1;
    border-radius: 24px;
    padding: 50px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-card:hover {
    border-color: #3b82f6;
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-5px);
}

.upload-icon {
    font-size: 3.5rem;
    color: #3b82f6;
    margin-bottom: 20px;
}

@media (max-width: 1024px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding-right: 20px;
    }
}