/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #222;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    padding: 20px 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s;
}

.logo:hover {
    color: #667eea;
    transform: scale(1.05);
}

.logo i {
    color: #667eea;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

.main-nav a {
    color: #555;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.main-nav a:hover {
    color: #667eea;
}

.main-nav a i {
    font-size: 0.9rem;
}

/* Main content */
main {
    flex: 1;
    max-width: 720px;
    margin: 2rem auto;
    width: 100%;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* Footer */
footer.site-footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(102, 126, 234, 0.1);
    padding: 30px 0;
    margin-top: 2rem;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
}

.footer-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-links {
    margin-bottom: 15px;
}

.footer-links a {
    color: #555;
    text-decoration: none;
    margin: 0 15px;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: #667eea;
    text-decoration: underline;
}

.footer-links a i {
    font-size: 0.8rem;
    margin-right: 0.3rem;
}

.footer-copyright {
    color: #777;
    font-size: 0.85rem;
}

/* Typography */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

h1 i {
    color: #667eea;
}

h2 {
    font-size: 1.8rem;
    margin-top: 40px;
    margin-bottom: 15px;
    color: #222;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

h2 i {
    color: #667eea;
    font-size: 1.4rem;
}

h3 {
    font-size: 1.3rem;
    margin-top: 25px;
    margin-bottom: 10px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

h3 i {
    color: #667eea;
}

p {
    margin-bottom: 20px;
    color: #444;
    line-height: 1.7;
}

a {
    color: #667eea;
}

a:hover {
    color: #764ba2;
}

/* Tool sections */
.tool-section {
    margin-bottom: 60px;
}

.intro {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 30px;
}

.trust-note {
    background: linear-gradient(135deg, #e8f4f8 0%, #f0e8f8 100%);
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    margin: 30px 0;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.trust-note strong {
    color: #667eea;
}

/* Tool list (homepage) */
.tool-list {
    display: grid;
    gap: 20px;
    margin: 40px 0;
}

.tool-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    padding: 25px;
    border-radius: 12px;
    border: 2px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-card:hover {
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
    transform: translateY(-4px);
    border-color: rgba(102, 126, 234, 0.3);
}

.tool-card h3 {
    margin-top: 0;
    font-size: 1.4rem;
}

.tool-card h3 a {
    text-decoration: none;
    color: #111;
}

.tool-card h3 a:hover {
    color: #667eea;
}

.tool-card p {
    margin-bottom: 0;
    color: #666;
}

/* Input groups */
.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

textarea,
input[type="text"],
input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color 0.2s;
}

textarea:focus,
input[type="text"]:focus,
input[type="file"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.error {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 8px;
    padding: 8px 12px;
    background-color: #f8d7da;
    border-radius: 4px;
}

.success {
    color: #155724;
    font-size: 0.9rem;
    margin-top: 8px;
    padding: 8px 12px;
    background-color: #d4edda;
    border-radius: 4px;
}

/* Actions */
.actions {
    margin-bottom: 30px;
    display: flex;
    gap: 10px;
}

button {
    padding: 10px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    background-color: #a0c4e8;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

button:active {
    transform: translateY(1px);
}

/* Preview container */
.preview-container {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.preview-container h2 {
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-color: #fff;
    border: 2px dashed #ddd;
    border-radius: 6px;
    margin-bottom: 20px;
    min-height: 200px;
}

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

.image-info {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #fff;
    border-radius: 6px;
}

.image-info p {
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.image-info strong {
    color: #333;
}

/* Content section */
.content-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid #e9ecef;
}

.content-section h2:first-child {
    margin-top: 0;
}

/* FAQ section */
.faq {
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #f5f0fa 100%);
    border-left: 4px solid #667eea;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.faq h3 {
    font-size: 1.2rem;
    margin-top: 0;
    margin-bottom: 10px;
    color: #222;
}

.faq p {
    margin-bottom: 0;
    color: #555;
}

/* Legal pages */
.legal-content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.legal-content h2 {
    margin-top: 30px;
}

.legal-content h2:first-of-type {
    margin-top: 0;
}

.legal-content ul {
    margin: 15px 0 20px 25px;
    color: #444;
}

.legal-content li {
    margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .header-container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .main-nav ul {
        gap: 15px;
    }

    .footer-links a {
        display: inline-block;
        margin: 5px 10px;
    }

    .actions {
        flex-direction: column;
    }

    button {
        width: 100%;
    }
}

/* Loader Spinner */
.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.processing-spinner {
    background: white;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.processing-spinner .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 15px;
}

.processing-spinner p {
    margin: 0;
    color: #333;
    font-weight: 600;
}

/* Alpine.js cloaking */
[x-cloak] {
    display: none !important;
}
