/* ===== Tools Page Styles ===== */

/* Tools Grid */
.tools-section {
    padding: 80px 0;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.tool-card {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 32px;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    cursor: pointer;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
}

.tool-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tool-icon i {
    font-size: 2rem;
    color: var(--white);
}

.tool-content {
    flex: 1;
}

.tool-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 8px;
}

.tool-content p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.tool-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
}

.tool-badge-new {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.tool-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.tool-arrow i {
    color: var(--text-light);
}

.tool-card:hover .tool-arrow {
    background: var(--primary);
}

.tool-card:hover .tool-arrow i {
    color: var(--white);
}

/* Tools Features */
.tools-features {
    padding: 80px 0;
    background: var(--gray-50);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.feature-item {
    text-align: center;
    padding: 30px;
    background: var(--white);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.feature-icon i {
    font-size: 1.5rem;
    color: var(--primary);
}

.feature-item h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 8px;
}

.feature-item p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ===== Tool Page Styles ===== */

.breadcrumb {
    background: var(--gray-50);
    padding: 16px 0;
    margin-top: 70px;
}

.breadcrumb a {
    color: var(--primary);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb a:hover {
    color: var(--primary-dark);
}

.tool-page {
    padding: 60px 0 100px;
}

.tool-header {
    text-align: center;
    margin-bottom: 48px;
}

.tool-header-icon {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.tool-header-icon i {
    font-size: 2.5rem;
    color: var(--white);
}

.tool-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 16px;
}

.tool-header p {
    color: var(--text-light);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Tool Workspace */
.tool-workspace {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: 40px;
    margin-bottom: 60px;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.02);
}

.upload-icon {
    width: 80px;
    height: 80px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.upload-icon i {
    font-size: 2rem;
    color: var(--primary);
}

.upload-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 8px;
}

.upload-content p {
    color: var(--text-light);
    margin-bottom: 8px;
}

.upload-info {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 24px;
}

.upload-btn {
    margin-top: 16px;
}

/* Processing Area */
.processing-area {
    padding: 80px 40px;
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: spin 1s linear infinite;
}

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

.processing-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 8px;
}

.processing-content p {
    color: var(--text-light);
}

/* Result Area */
.result-area {
    padding: 40px;
}

.result-images {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    margin-bottom: 32px;
}

.result-image-box {
    flex: 1;
    max-width: 400px;
}

.image-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 12px;
    text-align: center;
}

.image-container {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.image-container img {
    width: 100%;
    height: auto;
    display: block;
}

.checkered-bg {
    background-image:
        linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
        linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.result-arrow {
    width: 50px;
    height: 50px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.result-arrow i {
    color: var(--white);
    font-size: 1.25rem;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* Tool Features */
.tool-features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 60px;
}

.tool-feature {
    text-align: center;
    padding: 24px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.tool-feature i {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.tool-feature h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 6px;
}

.tool-feature p {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* How to Use */
.how-to-use {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 48px;
}

.how-to-use h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
    text-align: center;
    margin-bottom: 40px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.step {
    text-align: center;
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
    margin: 0 auto 16px;
}

.step h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 8px;
}

.step p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ===== Image Compressor Specific ===== */

.options-area {
    padding: 24px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.quality-control {
    max-width: 400px;
    margin: 0 auto;
}

.quality-control label {
    display: block;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 12px;
}

.quality-control input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--gray-200);
    appearance: none;
    cursor: pointer;
}

.quality-control input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

.quality-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 8px;
}

.file-list {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.file-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.file-list-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary);
}

.files-container {
    max-height: 400px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-100);
}

.file-item:last-child {
    border-bottom: none;
}

.file-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--gray-100);
    flex-shrink: 0;
}

.file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    color: var(--secondary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 0.85rem;
    color: var(--text-light);
}

.file-savings {
    font-weight: 600;
    color: #10b981;
}

.file-actions {
    display: flex;
    gap: 8px;
}

.file-list-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

.total-savings {
    font-size: 0.9rem;
    color: var(--text);
}

.total-savings strong {
    color: #10b981;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

/* ===== QR Code Generator Specific ===== */

.qr-workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.qr-generator {
    padding-right: 40px;
    border-right: 1px solid var(--gray-200);
}

.qr-types {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.qr-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 20px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
    min-width: 80px;
}

.qr-type-btn i {
    font-size: 1.25rem;
    color: var(--text-light);
}

.qr-type-btn span {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-light);
}

.qr-type-btn:hover,
.qr-type-btn.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.qr-type-btn:hover i,
.qr-type-btn.active i,
.qr-type-btn:hover span,
.qr-type-btn.active span {
    color: var(--primary);
}

.qr-inputs {
    margin-bottom: 24px;
}

.qr-form {
    display: none;
}

.qr-form.active {
    display: block;
}

.qr-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.qr-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.qr-options {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.option-group {
    flex: 1;
}

.option-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.color-input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    cursor: pointer;
    padding: 4px;
}

.btn-block {
    width: 100%;
}

.qr-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.preview-box {
    width: 100%;
    max-width: 350px;
    aspect-ratio: 1;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.qr-placeholder {
    text-align: center;
    color: var(--text-light);
}

.qr-placeholder i {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.qr-placeholder p {
    font-size: 0.9rem;
}

#qrCanvas {
    max-width: 100%;
    height: auto;
}

.preview-actions {
    display: flex;
    gap: 12px;
}

/* ===== Color Palette Generator Specific ===== */

.palette-workspace {
    padding: 32px;
}

.palette-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
}

.shortcut-hint {
    font-size: 0.875rem;
    color: var(--text-light);
}

.shortcut-hint kbd {
    display: inline-block;
    padding: 4px 8px;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.8rem;
}

.palette-container {
    display: flex;
    height: 300px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

.color-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 20px;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.color-block:hover {
    flex: 1.2;
}

.color-block.locked::before {
    content: '\f023';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 16px;
    right: 16px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
}

.color-info {
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 16px;
    border-radius: var(--radius);
    text-align: center;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition);
}

.color-block:hover .color-info {
    opacity: 1;
    transform: translateY(0);
}

.color-hex {
    font-family: monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 8px;
}

.color-actions {
    display: flex;
    gap: 8px;
}

.color-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--gray-100);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-action-btn:hover {
    background: var(--primary);
    color: var(--white);
}

.color-action-btn i {
    font-size: 0.8rem;
}

.palette-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.harmony-modes {
    background: var(--gray-50);
    padding: 24px;
    border-radius: var(--radius);
    text-align: center;
}

.harmony-modes h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

.mode-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mode-btn {
    padding: 8px 16px;
    border: 1px solid var(--gray-300);
    border-radius: 50px;
    background: var(--white);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
}

.mode-btn:hover,
.mode-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--white);
}

.saved-palettes {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 60px;
}

.saved-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.saved-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.saved-header h3 i {
    color: #ef4444;
}

.saved-container {
    min-height: 100px;
}

.empty-message {
    text-align: center;
    color: var(--text-light);
    padding: 40px;
}

.saved-palette {
    display: flex;
    height: 60px;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.saved-palette:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.saved-color {
    flex: 1;
}

/* ===== Toast Notifications ===== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    background: var(--secondary);
    color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: #10b981;
}

.toast.error {
    background: #ef4444;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .qr-workspace {
        grid-template-columns: 1fr;
    }

    .qr-generator {
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
        padding-bottom: 40px;
    }

    .tool-features {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .tools-section {
        padding: 40px 0;
    }

    .tool-card {
        padding: 24px;
        gap: 16px;
    }

    .tool-icon {
        width: 60px;
        height: 60px;
    }

    .tool-icon i {
        font-size: 1.5rem;
    }

    .tool-content h3 {
        font-size: 1.1rem;
    }

    .tool-content p {
        font-size: 0.9rem;
    }

    .tool-arrow {
        display: none;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .tool-page {
        padding: 40px 0 60px;
    }

    .tool-header h1 {
        font-size: 1.75rem;
    }

    .tool-header p {
        font-size: 1rem;
    }

    .tool-workspace {
        padding: 24px;
    }

    .upload-area {
        padding: 40px 20px;
    }

    .result-images {
        flex-direction: column;
    }

    .result-arrow {
        transform: rotate(90deg);
    }

    .result-image-box {
        max-width: 100%;
    }

    .result-actions {
        flex-direction: column;
        width: 100%;
    }

    .result-actions .btn {
        width: 100%;
    }

    .tool-features {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .steps {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .how-to-use {
        padding: 32px 24px;
    }

    .qr-types {
        justify-content: center;
    }

    .qr-type-btn {
        min-width: 70px;
        padding: 12px;
    }

    .qr-options {
        flex-direction: column;
    }

    .preview-actions {
        flex-direction: column;
        width: 100%;
    }

    .preview-actions .btn {
        width: 100%;
    }

    .palette-container {
        height: 200px;
    }

    .palette-actions {
        flex-wrap: wrap;
    }

    .palette-controls {
        flex-direction: column;
    }

    .file-item {
        flex-wrap: wrap;
    }

    .file-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }

    .file-list-footer {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .tool-card {
        flex-direction: column;
        text-align: center;
    }

    .tool-header-icon {
        width: 80px;
        height: 80px;
    }

    .tool-header-icon i {
        font-size: 2rem;
    }

    .qr-type-btn {
        flex: none;
        width: calc(33.33% - 6px);
    }

    .color-block {
        padding: 12px;
    }

    .color-info {
        padding: 8px 12px;
    }

    .color-hex {
        font-size: 0.75rem;
    }

    .color-action-btn {
        width: 28px;
        height: 28px;
    }

    .mode-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}
