/* Tools Page Styles */

.tools-section {
    padding: 60px 0;
}

.tool-page-content {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-white);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.tool-card {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: inherit;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    text-decoration: none;
    color: inherit;
}

.tool-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.tool-card h3 {
    font-size: 20px;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.tool-card p {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.tool-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.tool-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-colored);
}

/* Tool Modal */
.tool-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}

.tool-modal-content {
    background: var(--bg-white);
    border-radius: 20px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-2xl);
}

.tool-modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--bg-white);
    z-index: 10;
}

.tool-modal-header h2 {
    font-size: 24px;
    color: var(--text-dark);
}

.tool-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-light);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.tool-modal-close:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.tool-modal-body {
    padding: 32px;
}

/* Tool Form Styles */
.tool-form {
    max-width: 100%;
}

.tool-form .form-group {
    margin-bottom: 24px;
}

.tool-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
}

.tool-form input[type="text"],
.tool-form input[type="date"],
.tool-form input[type="color"],
.tool-form textarea,
.tool-form select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

.tool-form input[type="text"]:focus,
.tool-form textarea:focus,
.tool-form select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.tool-form input[type="range"] {
    width: calc(100% - 60px);
    margin-right: 12px;
}

.tool-form textarea {
    resize: vertical;
    min-height: 120px;
}

.tool-form input[type="checkbox"] {
    margin-right: 8px;
}

.tool-form .btn-primary,
.tool-form .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 8px;
    margin-bottom: 8px;
}

.tool-form .btn-primary {
    background: var(--primary-color);
    color: white;
}

.tool-form .btn-primary:hover {
    background: var(--primary-dark);
}

.tool-form .btn-secondary {
    background: var(--text-light);
    color: white;
}

.tool-form .btn-secondary:hover {
    background: #475569;
}

/* Password Display */
.password-display {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    letter-spacing: 2px;
    text-align: center;
    background: var(--bg-light);
}

.password-strength {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    background: var(--bg-light);
}

.strength-bar {
    height: 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    transition: all 0.3s;
}

.strength-bar.weak {
    width: 33%;
    background: #ef4444;
}

.strength-bar.medium {
    width: 66%;
    background: #f59e0b;
}

.strength-bar.strong {
    width: 100%;
    background: #10b981;
}

/* QR Preview */
.qr-preview {
    text-align: center;
    padding: 24px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-top: 16px;
}

.qr-preview img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

/* Counter Stats */
.counter-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.stat-box {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Color Preview */
.color-preview {
    width: 100%;
    height: 120px;
    border-radius: 12px;
    margin-top: 16px;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-color);
}

/* Date Result */
.date-result {
    background: var(--bg-light);
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    margin-top: 16px;
}

.date-result p {
    font-size: 18px;
    color: var(--text-dark);
    margin: 8px 0;
}

.date-result strong {
    color: var(--primary-color);
    font-size: 24px;
}

/* Responsive */
@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .tool-modal-content {
        max-width: 100%;
        margin: 10px;
    }
    
    .tool-modal-header,
    .tool-modal-body {
        padding: 20px;
    }
    
    .counter-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Error Message */
.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 8px;
    margin-top: 12px;
    border-left: 4px solid #ef4444;
}

/* Markdown Preview */
.markdown-preview {
    background: var(--bg-light);
    padding: 16px;
    border-radius: 8px;
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3 {
    margin: 12px 0 8px 0;
    color: var(--text-dark);
}

.markdown-preview p {
    margin: 8px 0;
    line-height: 1.6;
}

.markdown-preview ul {
    margin: 8px 0;
    padding-left: 24px;
}

.markdown-preview code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.markdown-preview strong {
    font-weight: 600;
}

.markdown-preview em {
    font-style: italic;
}

/* Regex Matches */
.regex-matches {
    background: var(--bg-light);
    padding: 16px;
    border-radius: 8px;
    min-height: 60px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.regex-matches p {
    margin: 8px 0;
    color: var(--text-dark);
}

/* BMI Result */
.bmi-result {
    background: var(--bg-light);
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    margin-top: 16px;
}

.bmi-result p {
    font-size: 18px;
    color: var(--text-dark);
    margin: 8px 0;
}

.bmi-result strong {
    color: var(--primary-color);
    font-size: 24px;
}

/* Unit Converter */
#unitFrom,
#unitTo {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    font-size: 14px;
}

/* Checkbox Styles */
label input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Select Styles */
select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Textarea Styles */
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea[readonly] {
    background: var(--bg-light);
    cursor: default;
}
