* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #000000;
    color: #000000;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

header h1 {
    color: #ffffff;
    font-size: 2.5rem;
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.github-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background-color: #24292e;
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.github-link:hover {
    background-color: #1a1e22;
    color: #ffffff;
    text-decoration: none;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background-color: #ffffff;
    color: #000000;
}

.btn-primary:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #333333;
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: #444444;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-danger {
    background-color: #ff4444;
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #cc0000;
}

.controls {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-box {
    width: 100%;
}

.search-box input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #333333;
    border-radius: 8px;
    background-color: #1a1a1a;
    color: #ffffff;
    font-size: 1rem;
    font-family: inherit;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-box input {
    flex: 1;
}

.search-box input:focus {
    outline: none;
    border-color: #ffffff;
}

.filter-box {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-box select {
    padding: 10px 16px;
    border: 2px solid #333333;
    border-radius: 8px;
    background-color: #1a1a1a;
    color: #ffffff;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
}

.filter-box select:focus {
    outline: none;
    border-color: #ffffff;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(255, 255, 255, 0.1);
}

.stat-label {
    font-size: 0.9rem;
    color: #666666;
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #000000;
}

.websites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.website-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.website-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 12px rgba(255, 255, 255, 0.15);
    border-color: #0066cc;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.card-title-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.card-favicon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    flex-shrink: 0;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #000000;
    flex: 1;
    word-break: break-word;
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-online {
    background-color: #00ff00;
    box-shadow: 0 0 4px #00ff00;
}

.status-offline {
    background-color: #ff4444;
}

.status-checking {
    background-color: #ffaa00;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    font-size: 1.2rem;
    color: #666666;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    color: #000000;
}

.icon-btn.favorite {
    color: #ffd700;
}

.card-url {
    color: #0066cc;
    text-decoration: none;
    font-size: 0.9rem;
    word-break: break-all;
    display: block;
    margin-top: 4px;
}

.card-url:hover {
    text-decoration: underline;
}

.card-category {
    display: inline-block;
    background-color: #f0f0f0;
    color: #000000;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.card-rating {
    color: #ffd700;
    font-size: 1rem;
    margin-top: 6px;
}

.card-notes {
    color: #333333;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-top: 4px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    font-size: 0.85rem;
    color: #666666;
}

.card-description {
    color: #555555;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-top: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #e0e0e0;
    border-top-color: #000000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 6px;
}

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

/* Analytics Styles */
.analytics-toggle {
    text-align: center;
    margin: 20px 0;
}

.analytics-section {
    margin-bottom: 30px;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.analytics-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(255, 255, 255, 0.1);
}

.analytics-card h3 {
    color: #000000;
    margin-bottom: 15px;
    font-size: 1.3rem;
    font-weight: 600;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.top-websites-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.top-website-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #f8f8f8;
    border-radius: 8px;
    border-left: 4px solid #0066cc;
}

.top-website-item .website-name {
    font-weight: 500;
    color: #000000;
    flex: 1;
}

.top-website-item .visit-count {
    font-weight: 700;
    color: #0066cc;
    background-color: #e6f3ff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.9rem;
}

.category-stats {
    margin-top: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.category-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #f8f8f8;
    border-radius: 6px;
    font-size: 0.9rem;
}

.category-stat-item .category-name {
    color: #333333;
}

.category-stat-item .category-count {
    font-weight: 600;
    color: #000000;
}

.activity-timeline {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.activity-item:hover {
    background-color: #f8f8f8;
}

.activity-item .activity-icon {
    font-size: 1.2rem;
    min-width: 24px;
}

.activity-item .activity-content {
    flex: 1;
}

.activity-item .activity-title {
    font-weight: 500;
    color: #000000;
    margin-bottom: 2px;
}

.activity-item .activity-meta {
    font-size: 0.85rem;
    color: #666666;
}

.health-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.health-stat, .pattern-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px;
    background-color: #f8f8f8;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.health-label, .pattern-label {
    font-size: 0.9rem;
    color: #666666;
    margin-bottom: 8px;
}

.health-value, .pattern-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #000000;
}

.usage-patterns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* Details Modal Styles */
.details-modal {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.details-content {
    padding: 0;
}

.details-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.details-favicon {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.details-favicon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.details-basic {
    flex: 1;
}

.details-basic h3 {
    margin: 0 0 5px 0;
    color: #000000;
    font-size: 1.5rem;
    font-weight: 600;
}

.details-url {
    color: #0066cc;
    text-decoration: none;
    font-size: 1rem;
    word-break: break-all;
    display: block;
    margin-bottom: 8px;
}

.details-url:hover {
    text-decoration: underline;
}

.details-meta {
    display: flex;
    gap: 15px;
    align-items: center;
}

.details-category {
    background-color: #e6f3ff;
    color: #0066cc;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.details-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

.detail-card {
    background-color: #f8f8f8;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e0e0e0;
}

.detail-card h4 {
    margin: 0 0 15px 0;
    color: #000000;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-stats, .detail-health {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.stat-item, .health-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #ffffff;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.stat-label, .health-label {
    color: #666666;
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-value, .health-value {
    color: #000000;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-description, .detail-notes {
    background-color: #ffffff;
    border-radius: 6px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    min-height: 60px;
}

.detail-description p, .detail-notes p {
    margin: 0;
    color: #333333;
    line-height: 1.5;
}

.details-actions {
    display: flex;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.ssl-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.ssl-valid {
    background-color: #d4edda;
    color: #155724;
}

.ssl-invalid {
    background-color: #f8d7da;
    color: #721c24;
}

.ssl-checking {
    background-color: #fff3cd;
    color: #856404;
}

/* Rating System */
.rating-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.star-rating {
    display: flex;
    gap: 4px;
}

.star {
    font-size: 1.5rem;
    cursor: pointer;
    color: #ddd;
    transition: color 0.2s ease;
}

.star:hover,
.star.active {
    color: #ffd700;
}

.rating-text {
    font-size: 0.9rem;
    color: #666666;
    font-style: italic;
}

/* Help Modal */
.help-content {
    padding: 20px;
}

.help-section {
    margin-bottom: 25px;
}

.help-section h3 {
    color: #000000;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

.shortcut-list {
    display: grid;
    gap: 10px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 12px;
    background-color: #f8f8f8;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.shortcut-item kbd {
    background-color: #000000;
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8rem;
    font-family: monospace;
    font-weight: bold;
    border: 1px solid #333333;
}

.shortcut-item span {
    color: #333333;
    font-size: 0.9rem;
}

.tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tips-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    color: #333333;
}

.tips-list li:last-child {
    border-bottom: none;
}

/* Chart responsiveness */
@media (max-width: 768px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .analytics-card canvas {
        width: 100% !important;
        height: auto !important;
    }

    .details-modal {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }

    .details-header {
        flex-direction: column;
        text-align: center;
    }

    .details-grid {
        grid-template-columns: 1fr;
        padding: 15px;
    }

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

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

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #ffffff;
    font-size: 1.2rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    color: #000000;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: #666666;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #000000;
}

form {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #000000;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    color: #000000;
    background-color: #ffffff;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #000000;
}

.form-group textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

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

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

    .filter-box {
        flex-direction: column;
    }

    .filter-box select,
    .filter-box button {
        width: 100%;
    }
}

