/* ===================================
   Professional Watermark Tool Styles
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===================================
   Container & Layout
   =================================== */

.wm-container {
    max-width: 1600px;
    margin: 0 auto;
}

/* ===================================
   Header
   =================================== */

.wm-header {
            text-align: center;
            margin-bottom: 1.5rem;
            padding: 1rem 0;
	color: #f70c3f;
        }

.wm-header h1 {
            font-size: 22px;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 0.5rem;
        }

.wm-subtitle {
    color: #9ca3af;
    font-size: 1.1rem;
}

/* ===================================
   Upload Section
   =================================== */

.wm-upload-section {
    margin-bottom: 2rem;
}

.wm-upload-area {
    border: 3px dashed rgba(239, 68, 68, 0.5);
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.wm-upload-area.drag-over {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
}

.wm-upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.wm-upload-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f3f4f6;
    margin-bottom: 0.5rem;
}

.wm-upload-text {
    color: #9ca3af;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.wm-upload-formats {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ===================================
   Main Grid Layout
   =================================== */

.wm-main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1200px) {
    .wm-main-grid {
        grid-template-columns: 380px 1fr;
    }
}

/* ===================================
   Settings Panel
   =================================== */

.wm-settings-panel {
    border-radius: 20px;
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 1rem;
    backdrop-filter: blur(10px);
}

.wm-panel-header {
    margin-bottom: 1.5rem;
}

.wm-panel-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ef4444;
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.wm-info-box {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-left: 4px solid #ef4444;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: start;
    gap: 0.75rem;
}

.wm-info-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.wm-info-box p {
    font-size: 0.9rem;
    color: #fca5a5;
    margin: 0;
}

/* ===================================
   Tabs
   =================================== */

.wm-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.wm-tab {
    background: rgba(55, 65, 81, 0.6);
    border: 2px solid rgba(75, 85, 99, 0.5);
    border-radius: 12px;
    padding: 0.875rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #d1d5db;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.wm-tab:hover {
    border-color: #ef4444;
    color: #fca5a5;
    transform: translateY(-2px);
}

.wm-tab.active {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

.wm-tab-content {
    display: none;
}

.wm-tab-content.active {
    display: block;
}

/* ===================================
   Form Controls
   =================================== */

.wm-control {
    margin-bottom: 1.5rem;
}

.wm-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #f3f4f6;
    margin-bottom: 0.5rem;
}

.wm-label span {
    color: #ef4444;
    font-weight: 700;
}

.wm-input {
    width: 100%;
    background: rgba(17, 24, 39, 0.8);
    border: 2px solid rgba(75, 85, 99, 0.5);
    border-radius: 10px;
    padding: 0.875rem;
    font-size: 1rem;
    color: #ffffff;
    transition: all 0.3s ease;
}

.wm-input:focus {
    outline: none;
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.wm-slider {
    width: 100%;
    height: 8px;
    background: rgba(55, 65, 81, 0.8);
    border-radius: 10px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.wm-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.5);
    transition: all 0.2s ease;
}

.wm-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.7);
}

.wm-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.5);
}

.wm-color-group {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 0.75rem;
}

.wm-color-picker {
    width: 100%;
    height: 50px;
    background: rgba(17, 24, 39, 0.8);
    border: 2px solid rgba(75, 85, 99, 0.5);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wm-color-picker:hover {
    border-color: #ef4444;
}

.wm-color-input {
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.wm-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.5), transparent);
    margin: 1.5rem 0;
}

/* ===================================
   Position Grid
   =================================== */

.wm-position-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.wm-pos-btn {
    background: rgba(55, 65, 81, 0.6);
    border: 2px solid rgba(75, 85, 99, 0.5);
    border-radius: 10px;
    padding: 0.75rem;
    font-size: 1.2rem;
    color: #d1d5db;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wm-pos-btn:hover {
    border-color: #ef4444;
    color: #fca5a5;
    transform: scale(1.05);
}

.wm-pos-btn.active {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

/* ===================================
   Buttons
   =================================== */

.wm-btn {
    background: rgba(55, 65, 81, 0.6);
    border: 2px solid rgba(75, 85, 99, 0.5);
    border-radius: 12px;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.wm-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.wm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.wm-btn-primary {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #ef4444;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

.wm-btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 30px rgba(239, 68, 68, 0.5);
}

.wm-btn-secondary {
    background: rgba(75, 85, 99, 0.6);
    border-color: rgba(107, 114, 128, 0.5);
}

.wm-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

.wm-btn-success:hover:not(:disabled) {
    box-shadow: 0 6px 30px rgba(16, 185, 129, 0.5);
}

.wm-btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-color: #dc2626;
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.3);
}

.wm-btn-danger:hover:not(:disabled) {
    box-shadow: 0 6px 30px rgba(220, 38, 38, 0.5);
}

.wm-btn-large {
    padding: 1.125rem 2rem;
    font-size: 1.1rem;
    width: 100%;
}

/* ===================================
   Watermark Preview (in settings)
   =================================== */

.wm-watermark-preview {
    margin-top: 1rem;
    min-height: 100px;
    background: rgba(17, 24, 39, 0.8);
    border: 2px solid rgba(75, 85, 99, 0.5);
    border-radius: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.wm-watermark-preview.active {
    display: flex;
}

.wm-watermark-preview img {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
}

/* ===================================
   Main Content Area
   =================================== */

.wm-main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ===================================
   Preview Section
   =================================== */

.wm-preview-section {
    border-radius: 20px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.wm-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.wm-preview-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #f3f4f6;
}

.wm-preview-subtitle {
    color: #9ca3af;
    font-size: 0.95rem;
}

.wm-preview-container {
    background: rgba(17, 24, 39, 0.8);
    border: 2px solid rgba(75, 85, 99, 0.5);
    border-radius: 15px;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

@media (max-width: 768px) {
    .wm-preview-container {
        min-height: 350px;
    }
}

.wm-preview-empty {
    text-align: center;
    color: #6b7280;
}

.wm-preview-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.wm-watermark-overlay {
    position: absolute;
    cursor: move;
    user-select: none;
    touch-action: none;
    z-index: 10;
    transition: opacity 0.2s ease;
}

.wm-watermark-overlay:hover {
    opacity: 0.9 !important;
}

.wm-watermark-overlay:active {
    cursor: grabbing;
}

/* ===================================
   Action Buttons
   =================================== */

.wm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .wm-actions {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   Gallery Section
   =================================== */

.wm-gallery-section {
    border-radius: 20px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.wm-gallery-header {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.wm-gallery-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #f3f4f6;
}

.wm-gallery-title span {
    color: #ef4444;
}

.wm-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

@media (max-width: 768px) {
    .wm-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

.wm-gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.wm-gallery-empty .wm-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.wm-gallery-empty p {
    margin: 0.5rem 0;
}

.wm-empty-hint {
    font-size: 0.9rem;
    color: #4b5563;
}

/* ===================================
   Gallery Item (Thumbnail)
   =================================== */

.wm-gallery-item {
    background: rgba(17, 24, 39, 0.8);
    border: 2px solid rgba(75, 85, 99, 0.5);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.wm-gallery-item:hover {
    border-color: #ef4444;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

.wm-gallery-item.active {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
}

.wm-gallery-item.processed {
    border-color: #10b981;
}

.wm-gallery-item.processed::after {
    content: '✓';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #10b981;
    color: #ffffff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.5);
    z-index: 2;
}

.wm-gallery-thumb {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.wm-gallery-info {
    padding: 0.75rem;
    background: rgba(31, 41, 55, 0.8);
}

.wm-gallery-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f3f4f6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.wm-gallery-size {
    font-size: 0.75rem;
    color: #9ca3af;
}

.wm-gallery-actions {
    padding: 0.5rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    background: rgba(17, 24, 39, 0.9);
}

.wm-gallery-btn {
    padding: 0.5rem;
    font-size: 0.85rem;
    border-radius: 8px;
    font-weight: 600;
}

.wm-gallery-btn-download {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #ef4444;
}

.wm-gallery-btn-delete {
    background: rgba(75, 85, 99, 0.6);
    border-color: rgba(107, 114, 128, 0.5);
    padding: 0.5rem 0.75rem;
}

/* ===================================
   Empty States
   =================================== */

.wm-empty-icon {
    font-size: 3rem;
    opacity: 0.5;
    margin-bottom: 1rem;
}

/* ===================================
   Processing Modal
   =================================== */

.wm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.wm-modal.active {
    display: flex;
}

.wm-modal-content {
    background: rgba(31, 41, 55, 0.95);
    border: 2px solid rgba(239, 68, 68, 0.5);
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.wm-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(75, 85, 99, 0.3);
    border-top-color: #ef4444;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.wm-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f3f4f6;
    margin-bottom: 0.5rem;
}

.wm-modal-text {
    color: #9ca3af;
    margin-bottom: 1.5rem;
}

.wm-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(55, 65, 81, 0.8);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.wm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
    transition: width 0.3s ease;
    border-radius: 10px;
}

.wm-modal-status {
    color: #d1d5db;
    font-weight: 600;
    font-size: 0.95rem;
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 768px) {
    .wm-title {
        font-size: 1.8rem;
    }
    
    .wm-subtitle {
        font-size: 0.95rem;
    }
    
    
    .wm-upload-area {
        padding: 2rem 1rem;
    }
    
    .wm-settings-panel {
        position: static;
    }
    
    .wm-preview-title,
    .wm-gallery-title {
        font-size: 1.1rem;
    }
}

/* ===================================
   Utility Classes
   =================================== */

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}