@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400&display=swap');

/* Reset en basis stijlen */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Rating Popover */
.rating-popover {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.popover-content {
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    max-width: 400px;
    text-align: center;
}

.popover-content h3 {
    margin-bottom: 24px;
    font-size: 1.25rem;
    color: #333;
}

.star-rating {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.star {
    font-size: 2.5rem;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.star:hover,
.star.hover {
    color: #ffd700;
    transform: scale(1.1);
}

.star.filled {
    color: #ff6600;
}

.close-popover {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s ease;
}

.close-popover:hover {
    color: #333;
}

/* App container - main layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid #e5e5e5;
    padding: 24px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    margin-bottom: 24px;
}

.sidebar-logo {
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    order: 3;
}

.codefor-logo {
    height: 32px;
    width: auto;
    opacity: 0.8;
}

.github-link {
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    margin: 12px 0;
}

.github-link:hover {
    color: #333;
}

.github-logo {
    width: 24px;
    height: 24px;
}

.sidebar-header h1 {
    font-size: 1.75rem;
    color: #1a1a1a;
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: -0.025em;
}

.sidebar-header h1 img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0;
}

.sidebar-header h2 {
    font-size: 0.95rem;
    color: #666;
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 20px;
}

.sidebar p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* Main navigation */
.main-nav {
    margin-bottom: 24px;
    order: 2;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 4px;
    background: #f0f2f5;
    border-radius: 8px;
    padding: 4px;
}

.main-nav li {
    flex: 1;
}

.main-nav .nav-link {
    display: block;
    padding: 10px 16px;
    text-decoration: none;
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-align: center;
}

.main-nav .nav-link:hover {
    color: #333;
    background: rgba(255, 255, 255, 0.7);
}

.main-nav .nav-link.active {
    color: #fff;
    background: #ff6600;
    box-shadow: 0 2px 4px rgba(255, 102, 0, 0.25);
}

/* Filter menu */
.filter-menu {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid #e5e5e5;
}

.filter-menu h3 {
    font-size: 1rem;
    color: #1a1a1a;
    font-weight: 500;
    margin-bottom: 16px;
}

.category-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-button {
    background: none;
    border: none;
    padding: 8px 12px;
    text-align: left;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
    transition: all 0.2s ease;
    text-transform: capitalize;
}

.filter-button:hover {
    background-color: #f5f5f5;
    color: #333;
}

.filter-button.active {
    background-color: #e5e5e5;
    color: #1a1a1a;
    font-weight: 500;
}

/* Content area */
.content-area {
    flex: 1;
    margin-left: 300px;
    padding: 32px;
}

/* Geschiedenis view */
.geschiedenis-view {
    margin-top: 20px;
}

.geschiedenis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.geschiedenis-view h2 {
    color: #1a1a1a;
    font-size: 1.5rem;
    margin: 0;
    font-weight: 600;
}

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

.history-action-btn {
    background-color: #ff6600;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.history-action-btn:hover {
    background-color: #e55a00;
}

.history-action-btn.danger {
    background-color: #dc3545;
}

.history-action-btn.danger:hover {
    background-color: #c82333;
}

/* Legacy support */
.clear-history-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.clear-history-btn:hover {
    background-color: #c82333;
}

.diensten-lijst {
    display: grid;
    gap: 16px;
}

.dienst-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
}

.dienst-item:hover {
    border-color: #ff6600;
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.1);
}

.dienst-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.dienst-info h3 {
    color: #1a1a1a;
    font-size: 1.1rem;
    margin-bottom: 4px;
    font-weight: 600;
}

.dienst-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.dienst-url {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    word-break: break-all;
    border-left: 3px solid #ff6600;
}

.dienst-url a {
    color: #ff6600;
    text-decoration: none;
}

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

.empty-state {
    text-align: center;
    color: #666;
    padding: 40px 20px;
    font-style: italic;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 16px;
}

/* Service cards */
.service-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.service-card:hover {
    border-color: #d4d4d4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.favicon-container {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.service-favicon {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    transition: all 0.3s;
}

.provider-favicon {
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 20px !important;
    height: 20px !important;
    border-radius: 50%;
    background-color: white !important;
    padding: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    border: 1px solid #e2e8f0;
}

.service-info {
    flex: 1;
    min-width: 0;
}

.service-info h4 {
    font-size: 1.1rem;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.service-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.4;
}

.service-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Service ratings in overview */
.service-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    background: rgba(255, 102, 0, 0.08);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 102, 0, 0.2);
    margin: 4px 0;
}

.service-rating .rating-stars {
    color: #ff6600;
    font-size: 0.9rem;
    font-weight: bold;
}

.service-rating .rating-text {
    color: #ff6600;
    font-weight: 600;
    font-size: 0.8rem;
}

.category-badge {
    font-size: 0.8rem;
    background-color: #f8f8f8;
    color: #666;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 400;
    text-transform: capitalize;
}

.provider-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #666;
}

.eu-flag {
    font-size: 1rem;
}

.non-eu-flag {
    position: relative;
    font-size: 1rem;
}

.eu-flag-base {
    opacity: 0.7;
}

.prohibited-symbol {
    position: absolute;
    top: 0;
    left: 0.1em;
    color: red;
    font-size: 1em !important;
}

.provider-name {
    font-weight: 400;
}

/* Quick actions sectie */
.quick-actions {
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.action-button {
    background-color: #EB8C3A;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: inline-block;
    text-decoration: none;
    margin: 0;
}

.action-button:hover {
    background-color: #e55500;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.action-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Responsive design */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
    }

    .content-area {
        margin-left: 0;
        padding: 16px;
    }

    .category-filters {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .filter-button {
        flex-shrink: 0;
    }

    /* Mobile responsive geschiedenis header */
    .geschiedenis-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .geschiedenis-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .history-action-btn {
        flex: 1;
        min-width: calc(50% - 4px);
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .history-action-btn.danger {
        flex-basis: 100%;
        margin-top: 4px;
    }
}

/* History view styling */
.date-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 24px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #EB8C3A;
}

.date-group {
    margin-bottom: 32px;
}

/* History service cards - use same base styling as service cards */
.history-card-wrapper {
    position: relative;
    margin-bottom: 12px;
}

.service-card.history-variant {
    width: 100%;
}

.delete-history-item {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background-color: transparent;
    color: #666;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    padding: 0;
}

.delete-history-item:hover {
    color: #333;
    transform: scale(1.1);
}

.delete-history-item:active {
    color: #000;
}

.history-title-container {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 4px;
    padding-right: 32px; /* Make room for delete button */
}

.history-title {
    margin: 0;
    display: inline;
    transition: color 0.2s ease;
}

.history-title:hover {
    color: #ff6600;
}

.rename-btn {
    background-color: transparent;
    color: #ccc;
    border: none;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
    vertical-align: baseline;
}

.rename-btn:hover {
    color: #ff6600;
}

.rename-btn:active {
    color: #e55a00;
}

.history-timestamp {
    font-size: 0.85rem;
    color: #999;
    font-weight: 500;
    margin: 4px 0 8px 0;
}

.history-url {
    font-size: 0.85rem;
    color: #007bff;
    font-family: 'Monaco', 'Consolas', monospace;
    margin: 4px 0 12px 0;
    word-break: break-all;
    background: #f8f9fa;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

/* Empty state for history */
.empty-state {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px dashed #ddd;
}

/* Clear history button */
.clear-history-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-bottom: 20px;
}

.clear-history-btn:hover {
    background: #c82333;
}

/* Service ratings in history */
.service-rating-history {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    background: rgba(255, 102, 0, 0.08);
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 102, 0, 0.2);
}

.service-rating-history .rating-stars {
    color: #ff6600;
    font-size: 0.95rem;
    font-weight: bold;
}

.service-rating-history .rating-text {
    color: #ff6600;
    font-weight: 600;
    font-size: 0.85rem;
}