/* Base Styles */
html, body {
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: #ffffff;
    color: #000000;
    transition: background-color 0.3s, color 0.3s;
}

body.dark {
    background-color: #000000;
    color: #ffffff;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

.header {
    background-color: #8660fd;
    padding: 16px;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-buttons {
    display: flex;
    gap: 8px;
}

.main-content {
    padding: 32px 0;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }
    .grid-2 {
        grid-template-columns: 1fr;
    }
    .header-content {
        flex-direction: column;
        gap: 16px;
    }
}

/* Form Elements */
.textarea {
    width: 100%;
    height: 200px;
    padding: 12px;
    border: 2px solid #8660fd;
    border-radius: 4px;
    resize: vertical;
    background-color: #ffffff;
    color: #000000;
    font-family: inherit;
    font-size: 14px;
}

.dark .textarea {
    background-color: #1f2937;
    color: #ffffff;
    border-color: #8660fd;
}

.control-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

/* Buttons */
.btn {
    background-color: #8660fd;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.3s;
    font-weight: 500;
    font-size: 14px;
}

.btn:hover {
    opacity: 0.9;
}

.clear-button {
    background-color: #ef4444;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.clear-button:hover {
    opacity: 0.9;
}

.button-group {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

/* Features and Cards */
.feature-card {
    background-color: #f3f4f6;
    padding: 16px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.dark .feature-card {
    background-color: #1f2937;
}

.settings-panel {
    background-color: #f3f4f6;
    padding: 16px;
    border-radius: 4px;
    margin-bottom: 24px;
}

.dark .settings-panel {
    background-color: #1f2937;
}

.settings-controls {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

/* Status and Indicators */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.success {
    background-color: #10b981;
    color: #ffffff;
}

.status-badge.warning {
    background-color: #f59e0b;
    color: #ffffff;
}

.stats {
    font-size: 12px;
    margin-top: 8px;
    color: #8660fd;
}

/* History and URL Analysis */
.history-panel {
    max-height: 300px;
    overflow-y: auto;
    padding: 16px;
    background-color: #ffffff;
    border-radius: 4px;
}

.dark .history-panel {
    background-color: #1f2937;
}

.url-breakdown {
    padding: 16px;
    border: 1px solid #8660fd;
    border-radius: 4px;
}

.diff-view {
    font-family: monospace;
    padding: 16px;
    background-color: #f3f4f6;
    border-radius: 4px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.dark .diff-view {
    background-color: #1f2937;
}

.diff-highlight {
    background-color: #8660fd;
    color: #ffffff;
    padding: 0 2px;
    border-radius: 2px;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 16px;
    right: 16px;
    background-color: #8660fd;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 4px;
    display: none;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Content Sections */
.prose {
    max-width: 800px;
    margin: 32px auto;
}

.prose h2 {
    font-size: 24px;
    margin-bottom: 16px;
    color: inherit;
}

.prose h3 {
    font-size: 20px;
    margin: 24px 0 12px;
    color: inherit;
}

.prose ul {
    list-style-type: disc;
    margin: 16px 0;
    padding-left: 24px;
}

.prose li {
    margin: 8px 0;
}

/* Disclaimer Section */
.disclaimer-section {
    margin: 32px 0;
    padding: 24px;
    background-color: #f3f4f6;
    border-radius: 4px;
}

.dark .disclaimer-section {
    background-color: #1f2937;
}

.disclaimer-card {
    margin: 16px 0;
    padding: 16px;
    border-left: 4px solid #8660fd;
}

/* Footer */
.footer {
    margin-top: 64px;
    padding: 32px 0;
    background-color: #f3f4f6;
    text-align: center;
    border-top: 1px solid #8660fd;
}

.dark .footer {
    background-color: #1f2937;
}

/* Utility Classes */
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }

/* Selection Color */
::selection {
    background-color: #8660fd;
    color: #ffffff;
}

/* Focus States */
.textarea:focus, 
.btn:focus,
.clear-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(134, 96, 253, 0.3);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.dark ::-webkit-scrollbar-track {
    background: #1f2937;
}

::-webkit-scrollbar-thumb {
    background: #8660fd;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #7451e3;
}