/* Global Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #1e1e1e;
    color: #e0e0e0;
}

h1 {
    text-align: center;
    color: #e0e0e0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

h2 {
    font-style: italic;
    color: #e0e0e0;
}

h3 {
    color: #e0e0e0;
}

/* Container Styles */
.container {
    background-color: #2d2d2d;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    margin: 0 auto;
}

/* Button Styles */
button, .button {
    padding: 10px 20px;
    background-color: #5c8e9c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

button:hover, .button:hover {
    background-color: #4a7a8a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

button:disabled {
    background-color: #444;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Form Styles */
input[type="file"] {
    display: none;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #555;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
    border-radius: 5px;
    cursor: pointer;
    background-color: #333;
}

.upload-area:hover {
    border-color: #777;
    background-color: #383838;
}

/* Hash/Content Box Styles */
.hash-box, .content-box {
    background-color: #333;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    word-break: break-all;
    color: #e0e0e0;
}

/* Label Styles */
.algo-name, .label-name {
    font-weight: bold;
    color: #e0e0e0;
    display: block;
    margin-top: 10px;
}

/* Slider Styles */
.slider-container {
    margin: 20px 0;
    background-color: #333;
    padding: 15px;
    border-radius: 5px;
}

.slider-container label {
    display: block;
    margin-bottom: 10px;
    color: #e0e0e0;
}

.slider {
    width: 100%;
    -webkit-appearance: none;
    height: 10px;
    border-radius: 5px;
    background: #444;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #5c8e9c;
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #5c8e9c;
    cursor: pointer;
}

/* Image Container */
.image-container {
    width: 100%;
    height: 500px;
    margin: 20px 0;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #333;
    background-image: linear-gradient(45deg, #222 25%, transparent 25%),
                      linear-gradient(-45deg, #222 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #222 75%),
                      linear-gradient(-45deg, transparent 75%, #222 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#preview-canvas {
    display: block;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Resolution Info */
.resolution-info {
    margin-top: 10px;
    color: #aaa;
    font-size: 14px;
    line-height: 1.4;
}

/* Button Container */
.buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

/* Sidebar Styles (for index.html) */
.sidebar {
    width: 200px;
    border: 1px solid #555;
    padding: 10px;
    margin-right: 20px;
    background-color: #2d2d2d;
    position: fixed;
    left: 20px;
    top: 20px;
    z-index: 6;
    border-radius: 8px;
}

.sidebar h2 {
    font-style: italic;
    font-size: 18px;
    margin: 0 0 10px 0;
}

.sidebar hr {
    border: 0;
    border-top: 1px dashed #555;
    margin: 10px 0;
}

.sidebar a {
    display: block;
    font-weight: bold;
    margin: 5px 0;
    text-decoration: none;
    color: #5c8e9c;
    transition: color 0.2s ease;
}

.sidebar a:hover {
    color: #4a7a8a;
}

/* Content Area (for index.html) */
.content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-left: 240px;
    position: relative;
    z-index: 1;
}

.box {
    border: 1px solid #555;
    padding: 20px;
    width: 300px;
    background-color: #2d2d2d;
    border-radius: 8px;
}

.box.rounded {
    border-radius: 20px;
}

.box h2 {
    font-style: italic;
    font-size: 24px;
    margin: 0 0 10px 0;
}

.box p {
    font-style: italic;
    margin: 0;
}

.box p.bold {
    font-weight: bold;
}

/* Utility Classes */
.hidden {
    display: none;
}

/* Animations */
@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Index page specific background */
body.index-page {
    background: linear-gradient(135deg, #0f0f0f, #1a1a1a, #252525);
    background-size: 400% 400%;
    background-attachment: fixed;
    animation: gradientAnimation 15s ease infinite;
    min-height: 100vh;
    overflow-x: hidden;
    box-sizing: border-box;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Hero Section */
.hero-section {
    padding: 80px 20px 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(92, 142, 156, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #5c8e9c, #7ab5c5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    letter-spacing: -2px;
}

.hero-title .highlight {
    font-weight: 300;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #aaa;
    margin-top: 10px;
    font-weight: 300;
    letter-spacing: 1px;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    width: 100%;
}

/* Tool Card */
.tool-card {
    background: linear-gradient(135deg, rgba(45, 45, 45, 0.9), rgba(35, 35, 35, 0.9));
    border: 1px solid rgba(92, 142, 156, 0.3);
    border-radius: 16px;
    padding: 35px;
    text-decoration: none;
    color: #e0e0e0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(92, 142, 156, 0.1));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.tool-card:hover {
    transform: translateY(-8px);
    border-color: rgba(92, 142, 156, 0.6);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(92, 142, 156, 0.2);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #5c8e9c, #4a7a8a);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: white;
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
}

.tool-card:hover .tool-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 20px rgba(92, 142, 156, 0.4);
}

.tool-title {
    font-size: 1.5rem;
    margin: 0 0 12px 0;
    color: #fff;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.tool-description {
    color: #aaa;
    line-height: 1.6;
    margin: 0 0 20px 0;
    flex-grow: 1;
    position: relative;
    z-index: 1;
}

.tool-arrow {
    font-size: 1.5rem;
    color: #5c8e9c;
    transition: transform 0.4s ease;
    position: relative;
    z-index: 1;
}

.tool-card:hover .tool-arrow {
    transform: translateX(8px);
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    margin-top: auto;
    border-top: 1px solid rgba(92, 142, 156, 0.2);
}

.footer p {
    margin: 0;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .tool-card {
        padding: 25px;
    }

    body.index-page {
        flex-direction: column;
        align-items: center;
    }

    .sidebar {
        position: static;
        margin-right: 0;
        margin-bottom: 20px;
    }

    .content {
        margin-left: 0;
        align-items: center;
    }
}