/* 
   Dashboard Styles for AI Tools
   Matches the main site's dark theme and design system
*/

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: calc(100vh - 80px);
    margin-top: 80px;
    position: relative;
}

/* Sidebar Styles */
.dashboard-sidebar {
    width: 280px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-light);
    position: fixed;
    left: 0;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s var(--ease-out);
}

.sidebar-header {
    padding: 2rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: rgba(99, 102, 241, 0.05);
    color: var(--text-main);
}

.sidebar-link.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
}

.sidebar-link svg {
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.sidebar-footer p {
    font-size: 0.85rem;
    margin: 0.25rem 0;
}

.sidebar-footer .text-muted {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Mobile Sidebar Toggle */
.mobile-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    z-index: 99;
    gap: 0.5rem;
    align-items: center;
    transition: all 0.3s ease;
}

.mobile-sidebar-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.5);
}

/* Main Content Area */
.dashboard-main {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
}

/* Tool Interface */
.tool-interface {
    position: relative;
}

.tool-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tool-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tool Header */
.tool-header {
    margin-bottom: 2.5rem;
}

.tool-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tool-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Input Section */
.tool-input-section {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group:last-child {
    margin-bottom: 0;
}

.input-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-group textarea,
.input-group select,
.input-group input {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    resize: vertical;
}

.input-group textarea:focus,
.input-group select:focus,
.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-group textarea::placeholder,
.input-group input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.input-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

/* Generate Button */
.btn-generate {
    width: 100%;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
    padding: 1rem 2rem;
    position: relative;
    overflow: hidden;
}

.btn-generate.loading {
    pointer-events: none;
}

.btn-generate.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    to {
        left: 100%;
    }
}

/* Ad Space */
.ad-space {
    margin: 2rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-light);
    border-radius: 12px;
    text-align: center;
}

.ad-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.ad-placeholder {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

/* Output Section */
.tool-output-section {
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.output-header h3 {
    font-size: 1.25rem;
    color: var(--text-main);
}

.btn-copy {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
}

.btn-copy.copied {
    background: #22c55e;
    border-color: #22c55e;
    color: white;
}

/* Result Box - Distinct Background */
.result-box {
    background: #1E293B;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    min-height: 200px;
    color: var(--text-main);
    font-size: 1rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
    position: relative;
}

[data-theme='light'] .result-box {
    background: #F1F5F9;
    border-color: rgba(0, 0, 0, 0.1);
    color: #0F172A;
}

.result-box:empty::before {
    content: 'Your generated content will appear here...';
    color: var(--text-muted);
    opacity: 0.5;
    font-style: italic;
}

/* Loading Animation */
.loading-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 3rem;
    color: var(--primary);
}

.loading-animation .dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-animation .dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-animation .dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .dashboard-main {
        margin-left: 0;
        padding: 1.5rem;
    }

    .dashboard-sidebar {
        transform: translateX(-100%);
    }

    .dashboard-sidebar.active {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

    .mobile-sidebar-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .dashboard-main {
        padding: 1rem;
    }

    .tool-header h1 {
        font-size: 2rem;
    }

    .tool-header p {
        font-size: 1rem;
    }

    .tool-input-section {
        padding: 1.5rem;
    }

    .input-row {
        grid-template-columns: 1fr;
    }

    .result-box {
        padding: 1.5rem;
        font-size: 0.95rem;
    }

    .output-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .btn-copy {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .tool-header h1 {
        font-size: 1.75rem;
    }

    .tool-input-section {
        padding: 1rem;
    }

    .btn-generate {
        font-size: 0.9rem;
        padding: 0.875rem 1.5rem;
    }

    .mobile-sidebar-toggle {
        bottom: 1rem;
        right: 1rem;
        padding: 0.875rem 1.25rem;
        font-size: 0.85rem;
    }
}

/* Scrollbar Styling */
.dashboard-sidebar::-webkit-scrollbar {
    width: 6px;
}

.dashboard-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.dashboard-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

.dashboard-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}