:root {
    --primary: #4361ee;
    --primary-light: #6a7ef0;
    --primary-dark: #314ac7;
    --secondary: #3a0ca3;
    --accent: #f72585;
    --accent-light: #f94a9b;
    --accent-dark: #d81159;
    --light: #f8f9fa;
    --dark: #212529;
    --success: #4cc9f0;
    --success-light: #6fd7f5;
    --warning: #ff9e00;
    --error: #e63946;
    --border: #dee2e6;
    --card-bg: #ffffff;
    --shadow: rgba(0, 0, 0, 0.08);
    --shadow-hover: rgba(0, 0, 0, 0.12);
    --text-muted: #6c757d;
    --gradient: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e6e9f0 100%);
    color: var(--dark);
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
}

h1 {
    font-size: 2.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 10px;
    font-weight: 800;
}

.tagline {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 20px;
    font-weight: 500;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 992px) {
    .main-content {
        grid-template-columns: 1fr 1fr;
    }
}

.card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 10px 30px var(--shadow);
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px var(--shadow-hover);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::before {
    opacity: 1;
}

.card-title {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.upload-area {
    border: 2px dashed var(--primary);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: rgba(67, 97, 238, 0.03);
}

.upload-area:hover {
    border-color: var(--accent);
    background: rgba(67, 97, 238, 0.05);
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: var(--accent);
    background: rgba(67, 97, 238, 0.1);
    transform: scale(1.02);
}

.upload-area i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.upload-area:hover i {
    color: var(--accent);
    transform: scale(1.1);
}

.upload-text {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--dark);
    font-weight: 500;
}

.upload-area p:last-of-type {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.file-input {
    display: none;
}

.btn {
    background: transparent; /* start with transparent for modern look */
    color: var(--primary); /* text color same as primary */
    border: 2px solid var(--primary); /* subtle border */
    padding: 12px 24px;
    border-radius: 45px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(67, 97, 238, 0.1); /* lighter shadow */
    position: relative;
    overflow: hidden;
}

/* Gradient shine effect stays */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

/* Hover effect now fills the button */
.btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(67, 97, 238, 0.3);
}

/* Click/active effect */
.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(67, 97, 238, 0.2);
}

/* Accent button */
.btn-accent {
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
    box-shadow: 0 4px 6px rgba(247, 37, 133, 0.1);
}

.btn-accent:hover {
    background: var(--accent);
    color: white;
    box-shadow: 0 6px 12px rgba(247, 37, 133, 0.3);
}

/* Success button */
.btn-success {
    background: transparent;
    color: var(--success);
    border: 2px solid var(--success);
    box-shadow: 0 4px 6px rgba(76, 201, 240, 0.1);
}

.btn-success:hover {
    background: var(--success);
    color: white;
    box-shadow: 0 6px 12px rgba(76, 201, 240, 0.3);
}

.preview-container {
    margin-top: 25px;
}

.preview-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Updated Preview Grid */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 15px;
}

@media (min-width: 768px) {
    .preview-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.image-preview {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    aspect-ratio: 1/1;
    transition: all 0.3s ease;
}

.image-preview:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-preview .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    color: var(--error);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.image-preview .remove-btn:hover {
    background: var(--error);
    color: white;
    transform: scale(1.1);
}

.url-container {
    background: var(--light);
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.url-text {
    flex: 1;
    word-break: break-all;
    padding: 10px;
    background: white;
    border-radius: 8px;
    font-family: monospace;
    border: 1px solid var(--border);
    font-size: 0.9rem;
}

.url-history {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.url-history::-webkit-scrollbar {
    width: 6px;
}

.url-history::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.url-history::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}

.url-history::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.url-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
    border-radius: 8px;
    margin-bottom: 5px;
}

.url-item:hover {
    background: var(--light);
    transform: translateX(5px);
}

.url-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.url-item:hover img {
    transform: scale(1.05);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
}

.url-details {
    flex: 1;
}

.url-details strong {
    display: block;
    margin-bottom: 5px;
    color: var(--dark);
}

.url-details p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.url-actions {
    display: flex;
    gap: 10px;
}

/* Enhanced Copy Button */
.copy-btn {
    position: relative;
    background: var(--primary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    overflow: hidden;
    box-shadow: 0 3px 6px rgba(67, 97, 238, 0.2);
}

.copy-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
    box-shadow: 0 5px 10px rgba(67, 97, 238, 0.3);
}

.copy-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.copy-btn:hover::before {
    width: 300%;
    height: 300%;
}

.copy-btn.copied {
    background: var(--success);
    animation: pulse 0.5s;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.copy-btn.copied i {
    animation: checkmark 0.5s ease;
}

@keyframes checkmark {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.action-btn {
    background: var(--light);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-muted);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.delete-btn:hover {
    background: var(--error);
}

.floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
}

.floating-btn:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: var(--accent-dark);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark);
    transition: all 0.3s ease;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    background: var(--light);
    color: var(--error);
    transform: rotate(90deg);
}

.empty-state {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #adb5bd;
}

.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin: 15px 0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress {
    height: 100%;
    background: var(--gradient);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: white;
    padding: 12px 25px;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    0% { transform: translateX(-50%) translateY(20px); opacity: 0; }
    100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* Loading animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .upload-area {
        padding: 20px;
    }
    
    .url-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .url-actions {
        align-self: center;
    }
    
    .preview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .card-title {
        font-size: 1.3rem;
    }
    
    .preview-grid {
        grid-template-columns: 1fr;
    }
    
    .floating-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
}
