:root {
    --bg-color: #1E1E2F;
    --text-color: #EAEAEA;
    --header-bg: #2B2D42;
    --accent-color: #FFD700;
    --tool-card-bg: #3A3D5B;
    --hover-accent: #E6C200;
    --shadow-color: rgba(255, 215, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

bodya {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 0;
    margin: 0;
    min-height: 100vh;
}

header {
    background-color: var(--header-bg);
    color: var(--accent-color);
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-color);
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    padding: 0 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.tool-card {
    background-color: var(--tool-card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tool-card:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
    transform: translateY(-5px);
    box-shadow: 0 8px 16px var(--shadow-color);
}

.tool-card h2 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: inherit;
}

.tool-card p {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    color: inherit;
    opacity: 0.9;
}

.tool-card .open-tool-btn {
    background-color: var(--accent-color);
    color: var(--bg-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-card:hover .open-tool-btn {
    background-color: var(--bg-color);
    color: var(--accent-color);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    overflow-y: auto;
}

.modal-content {
    background-color: var(--tool-card-bg);
    margin: 3% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 85%;
    max-width: 800px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-btn {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 1.8rem;
    color: var(--text-color);
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--accent-color);
}

#modalTitle {
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--accent-color);
}

/* Tool content styles */
.tool-section {
    margin-bottom: 1.5rem;
}

.tool-section h3 {
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 0.75rem;
    border-radius: 5px;
    border: 1px solid #555;
    background-color: #2B2D42;
    color: var(--text-color);
    font-size: 1rem;
}

.input-group input[type="range"] {
    padding: 0;
}

.input-group textarea {
    min-height: 120px;
    resize: vertical;
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.btn {
    background-color: var(--accent-color);
    color: var(--bg-color);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 120px;
    text-align: center;
}

.btn:hover {
    background-color: var(--hover-accent);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #555;
    color: var(--text-color);
}

.btn-secondary:hover {
    background-color: #666;
}

.result-container {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #2B2D42;
    border-radius: 5px;
    border-left: 4px solid var(--accent-color);
}

.result-container h4 {
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.preview-container {
    margin: 1rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.canvas-container {
    margin: 1rem 0;
    text-align: center;
}

canvas {
    max-width: 100%;
    border-radius: 5px;
}

.file-input-label {
    display: block;
    padding: 1rem;
    border: 2px dashed #555;
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 1rem;
}

.file-input-label:hover {
    border-color: var(--accent-color);
    background-color: rgba(255, 215, 0, 0.05);
}

.file-input-label i {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.file-info {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #AAA;
}

.range-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.range-group input[type="range"] {
    flex: 1;
}

.range-group span {
    min-width: 50px;
    text-align: center;
}

/* Responsive styles */
@media (max-width: 1024px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .modal-content {
        width: 90%;
        padding: 1.5rem;
    }
}

@media (max-width: 600px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
		
		main {
    padding: 0 .5rem;
		}
    
    header h1 {
        font-size: 2rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* Animation for tool cards */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-card {
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

/* Delay animations for each card */
.tool-card:nth-child(1) { animation-delay: 0.1s; }
.tool-card:nth-child(2) { animation-delay: 0.2s; }
.tool-card:nth-child(3) { animation-delay: 0.3s; }
.tool-card:nth-child(4) { animation-delay: 0.4s; }
.tool-card:nth-child(5) { animation-delay: 0.5s; }
.tool-card:nth-child(6) { animation-delay: 0.6s; }
.tool-card:nth-child(7) { animation-delay: 0.7s; }
.tool-card:nth-child(8) { animation-delay: 0.8s; }
.tool-card:nth-child(9) { animation-delay: 0.9s; }
.tool-card:nth-child(10) { animation-delay: 1.0s; }
.tool-card:nth-child(11) { animation-delay: 1.1s; }
.tool-card:nth-child(12) { animation-delay: 1.2s; }
.tool-card:nth-child(13) { animation-delay: 1.3s; }
.tool-card:nth-child(14) { animation-delay: 1.4s; }
.tool-card:nth-child(15) { animation-delay: 1.5s; }
.tool-card:nth-child(16) { animation-delay: 1.6s; }
.tool-card:nth-child(17) { animation-delay: 1.7s; }
.tool-card:nth-child(18) { animation-delay: 1.8s; }
.tool-card:nth-child(19) { animation-delay: 1.9s; }
.tool-card:nth-child(20) { animation-delay: 2.0s; }