/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fafafa;
}

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

/* Navigation */
.navbar {
    background: #fff;
    border-bottom: 1px solid #e1e5e9;
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-brand a {
    text-decoration: none;
    color: #2563eb;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover {
    color: #2563eb;
}

.nav-user {
    color: #64748b;
    font-weight: 500;
}

/* Main content */
.main-content {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #64748b;
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-outline {
    background: transparent;
    color: #2563eb;
    border: 1px solid #2563eb;
}

.btn-outline:hover {
    background: #2563eb;
    color: white;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* Hero section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-actions {
    margin-top: 2rem;
}

/* Features */
.features {
    padding: 4rem 0;
    background: white;
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #1f2937;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    border-radius: 0.5rem;
    background: #f8fafc;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #1f2937;
}

.feature-card p {
    color: #64748b;
}

/* Dashboard */
.dashboard {
    background: white;
    min-height: calc(100vh - 140px);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e1e5e9;
}

.dashboard-header h1 {
    color: #1f2937;
}

/* URL Cards */
.urls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
}

.url-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: box-shadow 0.2s;
}

.url-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.url-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.url-title {
    color: #1f2937;
    font-size: 1.125rem;
    font-weight: 600;
    margin-right: 1rem;
    word-break: break-word;
}

.url-status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.url-details p {
    margin-bottom: 0.5rem;
}

.url-link a {
    color: #2563eb;
    text-decoration: none;
    word-break: break-all;
}

.url-link a:hover {
    text-decoration: underline;
}

.url-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.meta-item {
    font-size: 0.875rem;
    color: #64748b;
}

.url-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

/* Forms */
.add-url {
    background: white;
    min-height: calc(100vh - 140px);
}

.add-url h1 {
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.add-url p {
    margin-bottom: 2rem;
    color: #64748b;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: #64748b;
    font-size: 0.875rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.form-messages {
    margin-top: 1.5rem;
}

.message {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.message-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.message-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Empty and loading states */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

.empty-state h3 {
    margin-bottom: 1rem;
    color: #374151;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

/* Status indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin: 0.25rem 0;
}

.status-never-checked {
    background: #f3f4f6;
    color: #6b7280;
}

.status-scraping-success {
    background: #dcfce7;
    color: #166534;
}

.status-scraping-error {
    background: #fee2e2;
    color: #991b1b;
}

.status-changes-detected {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.status-no-changes {
    background: #e0f2fe;
    color: #0369a1;
}

/* URL tooltips */
.url-with-tooltip {
    position: relative;
    cursor: help;
}

.url-with-tooltip .tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: white;
    text-align: center;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    transition: opacity 0.3s;
    word-break: break-all;
    max-width: 300px;
    white-space: normal;
}

.url-with-tooltip .tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
}

.url-with-tooltip:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

/* Change indicator */
.change-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.change-indicator:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Change notification with actions */
.change-notification {
    margin-top: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid #f59e0b;
    border-radius: 0.5rem;
}

.change-notification .change-indicator {
    display: block;
    background: none;
    color: #92400e;
    margin: 0 0 0.75rem 0;
    padding: 0;
    font-weight: 600;
    text-decoration: none;
}

.change-notification .change-indicator:hover {
    background: none;
    color: #92400e;
    transform: none;
    box-shadow: none;
}

.change-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.acknowledge-btn, .acknowledge-changes-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.acknowledge-btn:hover, .acknowledge-changes-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* URL Details */
.url-details {
    background: white;
    min-height: calc(100vh - 140px);
}

.url-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e1e5e9;
}

.url-header h1 {
    color: #1f2937;
    word-break: break-word;
    margin-right: 1rem;
}

.url-actions {
    display: flex;
    gap: 1rem;
}

.info-card {
    background: #f8fafc;
    border: 1px solid #e1e5e9;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.info-card h3 {
    margin-bottom: 1rem;
    color: #1f2937;
}

.info-card p {
    margin-bottom: 0.5rem;
}

.info-card a {
    color: #2563eb;
    text-decoration: none;
    word-break: break-all;
}

.info-card a:hover {
    text-decoration: underline;
}

.changes-section h2 {
    margin-bottom: 1.5rem;
    color: #1f2937;
}

.error-state {
    text-align: center;
    padding: 3rem;
}

.error-state h1 {
    margin-bottom: 1rem;
    color: #374151;
}

.error-state p {
    margin-bottom: 2rem;
    color: #64748b;
}

/* Footer */
.footer {
    background: #f8fafc;
    border-top: 1px solid #e1e5e9;
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer p {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.footer-links a {
    color: #64748b;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #2563eb;
}

/* Legal content styling */
.legal-content {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.legal-content h1 {
    color: #1f2937;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e1e5e9;
}

.legal-content h2 {
    color: #374151;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.legal-content p {
    margin-bottom: 1rem;
    color: #4b5563;
    line-height: 1.7;
}

.legal-content ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.legal-content li {
    margin-bottom: 0.5rem;
    color: #4b5563;
}

.legal-content a {
    color: #2563eb;
    text-decoration: none;
}

.legal-content a:hover {
    text-decoration: underline;
}

/* TermTracker Branding */
.termtracker-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

.termtracker-logo:hover {
    text-decoration: none;
}

.logo-icon {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.document-base {
    width: 28px;
    height: 36px;
    background: linear-gradient(145deg, #4f46e5, #6366f1);
    border-radius: 4px 4px 4px 4px;
    position: relative;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.document-corner {
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-top: 6px solid #e5e7eb;
    border-radius: 0 4px 0 0;
}

.document-lines {
    position: absolute;
    top: 8px;
    left: 4px;
    right: 4px;
}

.document-lines .line {
    height: 1.5px;
    background: rgba(255, 255, 255, 0.8);
    margin: 2px 0;
    border-radius: 1px;
}

.document-lines .line:nth-child(1) { width: 80%; }
.document-lines .line:nth-child(2) { width: 90%; }
.document-lines .line:nth-child(3) { width: 60%; }
.document-lines .line:nth-child(4) { width: 85%; }

.tracking-indicator {
    position: absolute;
    top: -3px;
    right: -5px;
    width: 14px;
    height: 14px;
    background: linear-gradient(145deg, #ef4444, #f87171);
    border-radius: 50%;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

.tracking-indicator::after {
    content: '!';
    color: white;
    font-weight: bold;
    font-size: 8px;
}

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

.termtracker-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
}

.termtracker-term {
    color: #4f46e5;
}

.termtracker-tracker {
    color: #6b7280;
}

.termtracker-tagline {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: normal;
    margin-top: 2px;
    display: block;
}

/* Navigation brand updates */
.nav-brand {
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-brand .termtracker-text {
    font-size: inherit;
}

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

.change-item {
    background: #f8fafc;
    border: 1px solid #e1e5e9;
    border-radius: 0.5rem;
    padding: 1.5rem;
}

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

.change-header h4 {
    color: #1f2937;
    margin: 0;
}

.change-type {
    background: #dbeafe;
    color: #1e40af;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.change-description {
    margin-bottom: 1rem;
}

.change-description p {
    color: #64748b;
    margin: 0;
}

.change-actions {
    border-top: 1px solid #f1f5f9;
    padding-top: 1rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        justify-content: center;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .urls-grid {
        grid-template-columns: 1fr;
    }

    .url-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .url-actions {
        flex-direction: column;
    }
}

/* Notification Badge */
.notification-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-badge {
    background: #dc2626;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    min-width: 1.25rem;
    text-align: center;
    line-height: 1.5;
}

/* Dashboard Filters */
.dashboard-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.filter-link {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    border-radius: 0.375rem 0.375rem 0 0;
    transition: all 0.2s;
    position: relative;
}

.filter-link:hover {
    background: #f1f5f9;
    color: #2563eb;
}

.filter-link.active {
    color: #2563eb;
    font-weight: 600;
}

.filter-link.active::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    right: 0;
    height: 2px;
    background: #2563eb;
}

/* Dashboard Actions */
.dashboard-actions {
    display: flex;
    gap: 0.75rem;
}

/* Bulk Actions */
.bulk-actions {
    background: #f8fafc;
    border: 1px solid #e1e5e9;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.bulk-actions-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.bulk-select-all {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: #475569;
}

.bulk-select-all input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.selected-count {
    color: #64748b;
    font-size: 0.875rem;
    margin-left: auto;
}

/* URL Checkbox */
.url-checkbox-label {
    display: flex;
    align-items: center;
    margin-right: 0.75rem;
}

.url-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: #2563eb;
}

.url-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .dashboard-filters {
        flex-direction: column;
        gap: 0.5rem;
    }

    .bulk-actions-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .selected-count {
        margin-left: 0;
    }
}