/**
 * PicWash - Tool Pages Shared Styles
 */

/* Tool Page Layout */
.tool-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.tool-main {
    flex: 1;
    padding: 120px 0 60px;
    background: var(--bg-light);
}

/* Tool Container */
.tool-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Tool Header */
.tool-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tool-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
}

.tool-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: 0.75rem;
}

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

/* Tool Interface */
.tool-interface {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Sidebar */
.tool-sidebar {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    border: 1px solid var(--border-light);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-title svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

/* Tool Options */
.tool-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tool-option {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tool-option label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.tool-option input[type="text"],
.tool-option input[type="number"],
.tool-option select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.938rem;
    font-family: inherit;
    transition: var(--transition-fast);
    background: var(--bg-white);
}

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

.tool-option input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    appearance: none;
    cursor: pointer;
}

.tool-option input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--gradient-primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
}

.range-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    text-align: right;
}

/* Checkbox & Radio */
.tool-option-inline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition-fast);
}

.tool-option-inline:hover {
    background: var(--bg-gray);
}

.tool-option-inline input[type="checkbox"],
.tool-option-inline input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Main Content Area */
.tool-content {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 2rem;
    border: 1px solid var(--border-light);
    min-height: 500px;
}

/* Upload Area */
.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-light);
}

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

.upload-area.has-image {
    padding: 0;
    border-style: solid;
}

.upload-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-radius: 50%;
    margin-bottom: 1.5rem;
}

.upload-icon svg {
    width: 40px;
    height: 40px;
    color: var(--primary);
}

.upload-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

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

.upload-formats {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.format-badge {
    padding: 0.25rem 0.75rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Image Preview */
.image-preview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.image-preview img {
    max-width: 100%;
    max-height: 500px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.image-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}

.image-action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.image-action-btn svg {
    width: 18px;
    height: 18px;
}

/* Action Buttons */
.tool-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}

.tool-actions .btn {
    flex: 1;
}

.btn-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
    box-shadow: 0 6px 20px 0 rgba(16, 185, 129, 0.5);
}

.btn-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.4);
}

/* Progress Bar */
.progress-container {
    display: none;
    margin-top: 2rem;
}

.progress-container.active {
    display: block;
}

.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Result Area */
.result-area {
    display: none;
    text-align: center;
}

.result-area.active {
    display: block;
}

.result-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    border-radius: 50%;
    animation: successPop 0.5s ease-out;
}

.result-icon svg {
    width: 40px;
    height: 40px;
    color: white;
}

@keyframes successPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.result-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1.5rem 0;
}

.result-stat {
    text-align: center;
}

.result-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.result-stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Other Tools Grid */
.other-tools {
    margin-top: 4rem;
}

.other-tools-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
}

/* Page Layout (Contact, Privacy, Terms) */
.page-main {
    flex: 1;
    padding: 120px 0 60px;
}

.page-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
}

.page-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Content Card */
.content-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    border: 1px solid var(--border-light);
    margin-bottom: 1.5rem;
}

.content-section {
    margin-bottom: 2rem;
}

.content-section:last-child {
    margin-bottom: 0;
}

.content-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.content-section h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.content-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.content-section ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.content-section li {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0.5rem;
}

/* Contact Form */
.contact-form {
    display: grid;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.938rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition-fast);
}

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

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* Contact Info */
.contact-info {
    display: grid;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
}

.contact-item-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-radius: var(--radius);
    flex-shrink: 0;
}

.contact-item-icon svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.contact-item-content h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.contact-item-content p {
    font-size: 0.938rem;
    color: var(--text-secondary);
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: var(--bg-light);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-fast);
}

.faq-question:hover {
    background: var(--bg-gray);
}

.faq-question svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
    transition: var(--transition);
}

.faq-item.active .faq-question svg {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item.active .faq-answer {
    padding: 1.25rem 1.5rem;
    max-height: 500px;
}

.faq-answer p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Dashboard (Start Editing) */
.dashboard {
    min-height: 100vh;
    display: flex;
}

.dashboard-sidebar {
    width: 280px;
    background: var(--text-primary);
    color: white;
    padding: 1.5rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.dashboard-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dashboard-logo .logo-icon {
    width: 40px;
    height: 40px;
}

.dashboard-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dashboard-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition-fast);
}

.dashboard-nav a:hover,
.dashboard-nav a.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.dashboard-nav a svg {
    width: 20px;
    height: 20px;
}

.dashboard-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    background: var(--bg-light);
    min-height: 100vh;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

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

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.dashboard-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    border: 1px solid var(--border-light);
    transition: var(--transition);
    cursor: pointer;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.dashboard-card-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
}

.dashboard-card-icon svg {
    width: 28px;
    height: 28px;
    color: var(--primary);
}

.dashboard-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.dashboard-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 1024px) {
    .tool-interface {
        grid-template-columns: 1fr;
    }
    
    .tool-sidebar {
        position: relative;
        top: 0;
    }
    
    .dashboard-sidebar {
        display: none;
    }
    
    .dashboard-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .tool-container,
    .page-container {
        padding: 0 1rem;
    }
    
    .tool-content {
        padding: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .result-stats {
        flex-direction: column;
        gap: 1rem;
    }
}
