/* Common Styles for All Tools */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Container Styles */
.container {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Tool Container (for individual tool pages) */
.tool-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    max-width: 600px;
    width: 100%;
    position: relative;
    z-index: 1;
    margin: 0 auto;
}

.tool-container.wide {
    max-width: 900px;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 28px;
}

.subtitle {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

/* Back Link */
.back-link {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 15px;
    font-weight: 500;
    transition: all 0.2s;
    padding: 6px 12px;
    border-radius: 6px;
}

.back-link:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateX(-3px);
}

/* Form Elements */
label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
    font-size: 14px;
}

input[type="text"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fafafa;
    font-family: inherit;
}

textarea {
    resize: vertical;
    min-height: 100px;
    font-family: 'Courier New', monospace;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input:hover:not(:focus),
textarea:hover:not(:focus),
select:hover:not(:focus) {
    border-color: #d0d0d0;
    background: white;
}

input.error,
textarea.error {
    border-color: #ff4444;
}

.error-message {
    color: #ff4444;
    font-size: 12px;
    margin-top: 5px;
    min-height: 18px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f0f0f0;
    color: #555;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Copy Button (absolute positioned) */
.input-wrapper {
    position: relative;
}

.copy-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    opacity: 0;
}

.input-wrapper:hover .copy-btn,
.input-wrapper input:focus ~ .copy-btn,
.input-wrapper textarea:focus ~ .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    background: #5568d3;
}

.copy-btn.copied {
    background: #10b981;
}

/* Form Groups */
.form-group {
    margin-bottom: 25px;
    position: relative;
}

/* Info Box */
.info-box {
    background: #f5f7ff;
    border-left: 4px solid #667eea;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.info-box h3 {
    color: #667eea;
    font-size: 14px;
    margin-bottom: 8px;
}

.info-box p {
    color: #666;
    font-size: 13px;
    line-height: 1.5;
}

.info-box ul,
.info-box ol {
    color: #666;
    font-size: 13px;
    line-height: 1.6;
    margin-left: 20px;
}

.info-box li {
    margin-bottom: 4px;
}

/* Stats/Results Display */
.stats-bar {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    margin: 20px 0;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

/* Examples/Quick Actions */
.examples {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.example-btn {
    background: linear-gradient(135deg, #f8f8f8 0%, #e8e8e8 100%);
    border: 1px solid #d0d0d0;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    color: #333;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.example-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #5568d3 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.example-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

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

.tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: all 0.2s;
}

.tab:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .tool-container {
        padding: 25px 20px;
    }

    h1 {
        font-size: 24px;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* Tools Index Page Specific */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.tool-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.tool-icon {
    font-size: 40px;
    margin-bottom: 15px;
    display: block;
}

.tool-card h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
}

.tool-card p {
    color: #666;
    line-height: 1.6;
    font-size: 15px;
    margin-bottom: 15px;
}

.tool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: #f0f0f0;
    color: #555;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.coming-soon {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.coming-soon::after {
    content: 'Coming Soon';
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

/* Index Page Header */
.index-header {
    text-align: center;
    margin-bottom: 50px;
    color: white;
}

.index-header h1 {
    font-size: 48px;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    color: white;
}

.index-header .subtitle {
    font-size: 18px;
    opacity: 0.95;
    font-weight: 300;
    color: white;
}

/* Footer */
footer {
    text-align: center;
    color: white;
    padding: 30px 20px;
    margin-top: 50px;
    opacity: 0.9;
}

footer p {
    font-size: 14px;
    line-height: 1.8;
}

footer a {
    color: white;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .index-header h1 {
        font-size: 36px;
    }

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

/* Related Tools Section */
.related-tools {
    margin-top: 40px;
    padding: 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.related-tools h3 {
    margin-bottom: 16px;
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.related-link {
    display: block;
    padding: 14px 18px;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    color: #667eea;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.related-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, #fff 0%, #f8f9ff 100%);
}
