/* ======================================================
   S4Skill — Online Tools Section Stylesheet
   Author: Sazzad Hossain
   Version: 1.0.0
====================================================== */

.tools-layout {
    margin-top: 2rem;
}

/* --- Sidebar Styling --- */
.tools-sidebar {
    position: sticky;
    top: 100px;
    z-index: 10;
}

.tools-nav-card {
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
}

.tools-nav-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

.tools-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tools-nav-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid transparent;
}

.tools-nav-item a:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.1);
    transform: translateX(3px);
}

.tools-nav-item.active a {
    color: #fff !important;
    background: var(--grad-primary);
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

.tools-nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* --- Main Tool Area Styling --- */
.tool-content-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.tool-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
}

.tool-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tool-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* --- Case Converter & Universal Textarea Styles --- */
.textarea-container {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card-2);
    transition: var(--transition);
    overflow: visible; /* Required to let settings dropdown show outside */
    margin-bottom: 1.5rem;
}

.textarea-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.tool-textarea {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-primary);
    padding: 1.25rem;
    font-size: 1.05rem;
    line-height: 1.6;
    outline: none;
    resize: vertical;
    min-height: 220px;
    font-family: inherit;
}

.textarea-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1rem;
}

[data-theme="light"] .textarea-toolbar {
    background: rgba(0, 0, 0, 0.03);
}

.toolbar-actions {
    display: flex;
    gap: 0.5rem;
    position: relative; /* Context for absolute settings dropdown */
}

.toolbar-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--glass-bg);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.toolbar-btn:hover {
    color: var(--text-primary);
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.toolbar-btn.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.text-stats {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Button grids for operations */
.action-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.tool-btn {
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--glass-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.tool-btn:hover {
    border-color: var(--primary);
    background: var(--grad-primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* --- QR Code Generator Styles --- */
.qr-preview-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card-2);
    padding: 2rem;
    transition: var(--transition);
}

.qr-canvas-wrapper {
    background: #fff;
    padding: 1rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    display: none;
}

.qr-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.qr-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.color-picker-group {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.color-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.color-picker-custom {
    width: 60px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: transparent;
    cursor: pointer;
    padding: 0;
}

/* --- JSON Formatter/Validator Styles --- */
.json-feedback {
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: none;
}

.json-feedback.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.json-feedback.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- Password Generator Styles --- */
.password-display-wrapper {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card-2);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.generated-password {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-all;
    user-select: all;
    letter-spacing: 1px;
}

.password-strength-bar {
    height: 6px;
    border-radius: 10px;
    margin-top: -1rem;
    margin-bottom: 1.5rem;
    background: var(--glass-bg);
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: var(--transition);
}

.strength-fill.weak { width: 33%; background: var(--danger); }
.strength-fill.medium { width: 66%; background: var(--accent); }
.strength-fill.strong { width: 100%; background: var(--success); }

.config-row {
    margin-bottom: 1.25rem;
}

.checkbox-custom {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.checkbox-custom input {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* Range input customization */
.range-slider-group {
    margin-bottom: 1.5rem;
}

.range-slider-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.range-slider {
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: var(--glass-bg);
    outline: none;
    accent-color: var(--primary);
}

/* --- Lorem Ipsum Generator Styles --- */
.lorem-options {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* --- Support block ("Buy me a coffee") --- */
.support-block {
    margin-left: auto;
}

.support-btn {
    background: #FFDD00;
    color: #000000 !important;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: var(--transition);
    border: none;
    box-shadow: 0 4px 12px rgba(255, 221, 0, 0.2);
}

.support-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 221, 0, 0.3);
}

/* Settings dropdown list */
.settings-dropdown {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 100;
    width: 280px;
}

.settings-dropdown.show {
    display: block;
}

.settings-dropdown h6 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.settings-option-item {
    margin-bottom: 0.75rem;
}

.settings-option-item:last-child {
    margin-bottom: 0;
}

/* Responsive sidebar */
@media (max-width: 991.98px) {
    .tools-sidebar {
        position: relative;
        top: 0;
        margin-bottom: 2rem;
    }
    .tools-nav-list {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        gap: 0.75rem;
    }
    .tools-nav-item a {
        white-space: nowrap;
    }
}

/* --- Navbar Tools Dropdown --- */
.navbar-custom .dropdown-menu {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 0.75rem 0;
    margin-top: 0.5rem;
}

.navbar-custom .dropdown-item {
    color: var(--text-secondary) !important;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: var(--transition);
}

.navbar-custom .dropdown-item:hover {
    color: var(--text-primary) !important;
    background: rgba(99, 102, 241, 0.08);
}

.navbar-custom .dropdown-header {
    color: var(--primary) !important;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 1.25rem 0.25rem;
}

.navbar-custom .dropdown-divider {
    border-color: var(--border-color);
}

/* --- File Converter Styles --- */
.upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card-2);
    padding: 2.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 1.5rem;
    position: relative;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.03);
}

.upload-zone i {
    font-size: 3.5rem;
    margin-bottom: 1.25rem;
    color: var(--primary);
    transition: var(--transition);
}

.upload-zone:hover i {
    transform: translateY(-5px);
}

.upload-zone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-info-box {
    background: var(--bg-card-2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-info-details {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-icon {
    font-size: 2rem;
    color: var(--primary);
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
    max-width: 300px;
}

.file-size {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.progress-container {
    margin-bottom: 1.5rem;
}

.progress-bar-custom {
    height: 8px;
    background: var(--glass-bg);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--grad-primary);
    width: 0%;
    transition: width 0.2s ease;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.download-box {
    background: rgba(16, 185, 129, 0.05);
    border: 1px dashed var(--success);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.download-box h5 {
    color: var(--success);
    font-weight: 700;
    margin: 0;
}

.preview-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #fff;
    color: #000;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.dark-preview {
    background: var(--bg-card-2);
    color: var(--text-primary);
}

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.preview-thumb-card {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-card);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-thumb-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.thumb-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.thumb-remove:hover {
    background: rgb(239, 68, 68);
    transform: scale(1.1);
}

.audio-player-wrapper {
    background: var(--bg-card-2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.audio-player-wrapper audio {
    width: 100%;
}

