:root {
    --primary: #dc2626;
    --primary-dark: #b91c1c;
    --primary-light: #fca5a5;
    --secondary: #f59e0b;
    --secondary-dark: #d97706;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #1f2937;
    --gray: #6b7280;
    --gray-light: #9ca3af;
    --light: #f9fafb;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    color: var(--dark);
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(220, 38, 38, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(245, 158, 11, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.03) 2px,
        rgba(255, 255, 255, 0.03) 4px
    );
    pointer-events: none;
    z-index: 0;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.tool-header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    position: relative;
}

.back-btn {
    position: absolute;
    left: 0;
    top: 0;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-5px);
}

.tool-header h1 {
    font-size: 48px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.tool-header p {
    font-size: 18px;
    opacity: 0.95;
}

.tool-container {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.tool-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--info));
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.upload-area {
    border: 3px dashed #d1d5db;
    border-radius: var(--radius-lg);
    padding: 60px 30px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.1), transparent);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.upload-area:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.upload-area:hover::before {
    width: 300px;
    height: 300px;
}

.upload-area.dragover {
    border-color: var(--primary);
    background: linear-gradient(135deg, #fff5f5, #ffe8e8);
    transform: scale(1.03);
}

.upload-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 15px;
}

.upload-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 14px;
    color: var(--gray);
}

.file-input {
    display: none;
}

.file-list {
    margin: 25px 0;
    max-height: 400px;
    overflow-y: auto;
}

.file-item {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.file-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    transform: scaleY(0);
    transition: transform 0.3s;
}

.file-item:hover {
    background: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.file-item:hover::before {
    transform: scaleY(1);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.file-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: var(--dark);
    font-size: 15px;
    margin-bottom: 4px;
    word-break: break-word;
}

.file-size {
    font-size: 13px;
    color: var(--gray);
}

.remove-btn {
    background: var(--danger);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.remove-btn:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.input-group {
    margin: 25px 0;
}

.input-group label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 10px;
}

.input-field {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.action-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 25px;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.5);
}

.action-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}

.progress-container {
    display: none;
    margin: 25px 0;
}

.progress-container.show {
    display: block;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--gray);
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.4s;
    width: 0%;
}

.result-area {
    display: none;
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-radius: 16px;
    margin-top: 25px;
    border: 2px solid #86efac;
}

.result-area.show {
    display: block;
}

.success-icon {
    font-size: 72px;
    display: block;
    margin-bottom: 20px;
}

.result-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 10px;
}

.result-text {
    font-size: 15px;
    color: var(--gray);
    margin-bottom: 25px;
}

.download-btn {
    padding: 16px 40px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.download-btn:hover {
    background: #059669;
    transform: scale(1.05);
}

.info-box {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.info-box h3 {
    font-size: 20px;
    color: var(--dark);
    margin-bottom: 15px;
}

.info-box ol {
    color: var(--gray);
    line-height: 1.8;
    padding-left: 25px;
}

.info-box ol li {
    margin-bottom: 10px;
}

.info-box p {
    color: var(--gray);
    line-height: 1.7;
    margin-top: 15px;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 0;
    }
    
    .tool-header {
        margin-bottom: 25px;
    }
    
    .tool-header h1 {
        font-size: 28px;
        margin-bottom: 8px;
    }
    
    .tool-header p {
        font-size: 14px;
    }
    
    .tool-container {
        padding: 20px;
        border-radius: 16px;
    }
    
    .back-btn {
        position: static;
        display: inline-block;
        margin-bottom: 20px;
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .upload-area {
        padding: 40px 20px;
        border-width: 2px;
    }
    
    .upload-icon {
        font-size: 48px;
        margin-bottom: 12px;
    }
    
    .upload-text {
        font-size: 16px;
    }
    
    .upload-hint {
        font-size: 12px;
    }
    
    .file-item {
        padding: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .file-info {
        width: 100%;
        gap: 12px;
    }
    
    .file-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
        flex-shrink: 0;
    }
    
    .file-name {
        font-size: 14px;
    }
    
    .file-size {
        font-size: 12px;
    }
    
    .remove-btn {
        width: 100%;
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .input-group label {
        font-size: 14px;
    }
    
    .input-field {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .action-btn {
        padding: 14px;
        font-size: 16px;
        margin-top: 20px;
    }
    
    .progress-info {
        font-size: 12px;
    }
    
    .progress-bar {
        height: 8px;
    }
    
    .result-area {
        padding: 25px 20px;
    }
    
    .success-icon {
        font-size: 56px;
        margin-bottom: 15px;
    }
    
    .result-title {
        font-size: 20px;
    }
    
    .result-text {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .download-btn {
        padding: 12px 30px;
        font-size: 16px;
        width: 100%;
    }
    
    .copy-btn {
        padding: 10px 24px;
        font-size: 14px;
        width: 100%;
        margin: 8px 0;
    }
    
    .info-box {
        padding: 20px;
        margin-top: 20px;
    }
    
    .info-box h3 {
        font-size: 18px;
    }
    
    .info-box ol {
        font-size: 14px;
        padding-left: 20px;
    }
    
    .text-result {
        padding: 15px;
        font-size: 12px;
        max-height: 300px;
    }
    
    .alert-box {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    input[type="range"] {
        width: calc(100% - 50px);
    }
    
    .api-promo {
        padding: 30px 20px;
        margin: 30px 0;
        border-radius: 16px;
    }
    
    .api-promo-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .api-promo-text h2 {
        font-size: 24px;
        margin-bottom: 15px;
    }
    
    .api-promo-text p {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .api-features-list {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .api-feature-item {
        font-size: 13px;
    }
    
    .btn-api,
    .btn-api-secondary {
        display: block;
        width: 100%;
        text-align: center;
        margin: 8px 0;
        padding: 12px 24px;
        font-size: 14px;
    }
    
    .code-preview pre {
        padding: 15px;
        font-size: 11px;
    }
    
    .code-preview code {
        font-size: 11px;
        line-height: 1.6;
    }
    
    .code-header {
        padding: 10px 15px;
        font-size: 11px;
    }
    
    .footer-content-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .footer-col h3 {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .footer-col p,
    .footer-col ul li a {
        font-size: 13px;
    }
    
    .social-links {
        gap: 12px;
    }
    
    .social-links a {
        font-size: 20px;
    }
    
    .footer-bottom {
        padding-top: 20px;
        font-size: 13px;
    }
}

/* Extra small devices (phones in portrait, less than 576px) */
@media (max-width: 576px) {
    body {
        padding: 5px;
    }
    
    .tool-header h1 {
        font-size: 24px;
    }
    
    .tool-header p {
        font-size: 13px;
    }
    
    .tool-container {
        padding: 15px;
        border-radius: 12px;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .upload-icon {
        font-size: 40px;
    }
    
    .upload-text {
        font-size: 14px;
    }
    
    .file-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .action-btn {
        padding: 12px;
        font-size: 15px;
    }
    
    .result-area {
        padding: 20px 15px;
    }
    
    .success-icon {
        font-size: 48px;
    }
    
    .result-title {
        font-size: 18px;
    }
    
    .api-promo {
        padding: 20px 15px;
    }
    
    .api-promo-text h2 {
        font-size: 20px;
    }
    
    .code-preview pre {
        padding: 12px;
        font-size: 10px;
    }
}

/* Landscape orientation fixes */
@media (max-height: 600px) and (orientation: landscape) {
    .tool-header {
        margin-bottom: 15px;
    }
    
    .tool-header h1 {
        font-size: 24px;
    }
    
    .upload-area {
        padding: 25px 20px;
    }
    
    .upload-icon {
        font-size: 36px;
        margin-bottom: 8px;
    }
    
    .result-area {
        padding: 20px;
    }
    
    .success-icon {
        font-size: 40px;
        margin-bottom: 10px;
    }
}



.alert-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid var(--warning);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 20px 0;
    font-size: 14px;
    color: #92400e;
    line-height: 1.6;
}

.alert-box strong {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
}

.text-result {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius);
    padding: 25px;
    margin: 25px 0;
    max-height: 400px;
    overflow-y: auto;
    text-align: left;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.8;
    color: var(--dark);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.copy-btn {
    margin: 10px 5px;
    padding: 12px 30px;
    background: var(--info);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.copy-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

input[type="range"] {
    width: calc(100% - 60px);
    margin-right: 10px;
    vertical-align: middle;
}

#opacityValue {
    display: inline-block;
    min-width: 50px;
    font-weight: 600;
    color: var(--primary);
}

.tool-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
    vertical-align: middle;
}

.tool-badge.new {
    background: linear-gradient(135deg, #10b981, #059669);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.feature-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-md);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}


/* Footer Styles */
.footer-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    font-size: 18px;
    color: var(--dark);
    margin-bottom: 20px;
    font-weight: 700;
}

.footer-col p {
    color: var(--gray);
    line-height: 1.7;
    font-size: 14px;
    margin-bottom: 15px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: var(--gray);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-col ul li a:hover {
    color: var(--primary);
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-links a {
    font-size: 24px;
    text-decoration: none;
    transition: transform 0.3s;
}

.social-links a:hover {
    transform: scale(1.2);
}

.footer-bottom {
    border-top: 2px solid #e5e7eb;
    padding-top: 30px;
    text-align: center;
}

/* API Promo Section */
.api-promo {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 24px;
    padding: 60px 40px;
    margin: 50px 0;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

.api-promo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(220, 38, 38, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.api-promo-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.api-promo-text h2 {
    font-size: 36px;
    color: white;
    margin-bottom: 20px;
}

.api-promo-text p {
    font-size: 18px;
    color: #e5e7eb;
    line-height: 1.8;
    margin-bottom: 25px;
}

.api-features-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 25px 0;
}

.api-feature-item {
    color: #e5e7eb;
    font-size: 15px;
    font-weight: 500;
}

.btn-api {
    display: inline-block;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s;
    margin-right: 15px;
}

.btn-api:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(220, 38, 38, 0.4);
}

.btn-api-secondary {
    display: inline-block;
    padding: 14px 32px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s;
}

.btn-api-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.code-preview {
    background: #0f172a;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #334155;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.code-header {
    background: #1e293b;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #334155;
    font-size: 13px;
    color: #94a3b8;
    font-weight: 600;
}

.code-preview pre {
    margin: 0;
    padding: 25px;
    overflow-x: auto;
}

.code-preview code {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.8;
    color: #e5e7eb;
}

@media (max-width: 768px) {
    .api-promo-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .api-features-list {
        grid-template-columns: 1fr;
    }
    
    .footer-content-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}
