* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

header {
    text-align: center;
    margin-bottom: 40px;
}

.header-logo {
    max-width: 150px;
    height: auto;
    margin-bottom: 20px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #3498db;
    text-decoration: none;
    font-size: 0.95rem;
}

.back-link:hover {
    text-decoration: underline;
}

/* Landing Page Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.tool-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.tool-card:hover {
    border-color: #3498db;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.2);
}

.tool-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.tool-card h2 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.tool-card p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

input[type="text"],
input[type="url"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #3498db;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s ease;
}

.btn:hover {
    background: #2980b9;
}

.btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

.btn-secondary {
    background: #95a5a6;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* Tabs/Pills */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    flex-wrap: wrap;
}

.tab {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    color: #7f8c8d;
    transition: all 0.3s ease;
}

.tab:hover {
    color: #2c3e50;
}

.tab.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Preview Area */
.preview {
    margin: 30px 0;
    padding: 30px;
    background: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 8px;
    text-align: center;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.preview-empty {
    color: #95a5a6;
    font-style: italic;
}

/* File Upload */
.upload-area {
    margin: 20px 0;
    padding: 40px;
    border: 2px dashed #3498db;
    border-radius: 8px;
    text-align: center;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    background: #e8f4f8;
    border-color: #2980b9;
}

.upload-area.drag-over {
    background: #d4e9f7;
    border-color: #2980b9;
}

.upload-area input[type="file"] {
    display: none;
}

.upload-label {
    cursor: pointer;
    display: block;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.upload-icon {
    font-size: 3rem;
}

.upload-content p {
    font-size: 1.1rem;
    color: #2c3e50;
    margin: 0;
}

.upload-content small {
    color: #7f8c8d;
}

/* Preview Grid */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.preview-item {
    text-align: center;
}

.preview-item h3 {
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 1.1rem;
}

.preview-item img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Checkered Background (for transparency) */
.checkered-bg {
    background-image:
        linear-gradient(45deg, #ccc 25%, transparent 25%),
        linear-gradient(-45deg, #ccc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ccc 75%),
        linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    padding: 10px;
    border-radius: 4px;
    display: inline-block;
}

/* Spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Operation Options */
.operation-options {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Utility Classes */
.hidden {
    display: none;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: #ecf0f1;
    margin-top: 40px;
    padding: 40px 20px 20px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 40px;
}

.footer-logo {
    max-width: 120px;
    height: auto;
    margin-bottom: 12px;
}

.footer-brand h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    color: #ecf0f1;
}

.footer-brand p {
    color: #95a5a6;
    font-size: 1rem;
}

.footer-qr {
    text-align: center;
}

.footer-qr h4 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: #ecf0f1;
}

.qr-code-footer {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
    background: white;
    padding: 8px;
}

.qr-code-footer:hover {
    transform: scale(1.05);
}

.qr-label {
    font-size: 14px;
    margin-top: 8px;
    color: #95a5a6;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #34495e;
}

.footer-bottom p {
    color: #95a5a6;
    font-size: 0.9rem;
}

.footer-bottom a {
    color: #3498db;
    text-decoration: none;
}

.footer-bottom a:hover {
    text-decoration: underline;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    animation: zoom 0.3s;
}

@keyframes zoom {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #bbb;
}

#caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 50px;
    font-size: 1.2rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 2rem;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-brand h2 {
        font-size: 1.5rem;
    }
}
