/* Testkoekkenet 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: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
    gap: 2rem;
}

.logo h1 {
    font-size: 1.75rem;
    color: #d32f2f;
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.logo a {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Navigation Menu - Modern Design (isolated from Materialize) */
.site-header nav.main-nav,
.site-header .main-nav {
    background: #fff !important;
    background-color: #fff !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.main-nav {
    flex: 1;
    display: flex !important;
    justify-content: center;
    align-items: center;
    background: transparent !important;
}

.main-nav ul,
.main-nav .nav-menu,
.main-nav .main-nav-list,
.site-header nav.main-nav ul,
.site-header nav.main-nav .nav-menu {
    display: flex !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    align-items: center !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.main-nav ul li,
.main-nav .nav-menu li,
.main-nav .main-nav-list li,
.site-header nav.main-nav ul li,
.site-header nav.main-nav .nav-menu li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    background: transparent !important;
    border: none !important;
    position: relative;
}

.main-nav a,
.main-nav .nav-menu a,
.main-nav .main-nav-list a,
.site-header nav.main-nav a,
.site-header nav.main-nav .nav-menu a {
    color: #333 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    font-size: 0.95rem !important;
    padding: 0.75rem 1.25rem !important;
    display: block !important;
    transition: all 0.2s ease !important;
    border-radius: 6px !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.main-nav a:hover,
.main-nav .nav-menu a:hover,
.main-nav .main-nav-list a:hover,
.site-header nav.main-nav a:hover,
.site-header nav.main-nav .nav-menu a:hover {
    color: #d32f2f !important;
    background-color: rgba(211, 47, 47, 0.05) !important;
    text-decoration: none !important;
}

.user-menu {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: nowrap;
}

.user-name {
    color: #666;
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-login, .btn-register, .btn-logout, .btn-vote, .btn-unlock {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background-color: #d32f2f;
    color: white;
}

.btn-primary:hover {
    background-color: #b71c1c;
}

.btn-secondary {
    background-color: #666;
    color: white;
}

.btn-secondary:hover {
    background-color: #555;
}

.btn-login, .btn-register {
    background-color: #fff;
    color: #333;
    border: 1.5px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.btn-login:hover, .btn-register:hover {
    background-color: #f8f8f8;
    color: #d32f2f;
    border-color: #d32f2f;
    box-shadow: 0 2px 6px rgba(211, 47, 47, 0.15);
    transform: translateY(-1px);
}

.btn-logout {
    background-color: #f5f5f5;
    color: #333;
}

/* Frontpage */
.frontpage {
    padding: 2rem 0;
}

.hero {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, #d32f2f 0%, #f44336 100%);
    color: white;
    border-radius: 8px;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.test-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.test-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.test-card a {
    text-decoration: none;
    color: inherit;
}

.test-card h3 {
    color: #d32f2f;
    margin-bottom: 0.5rem;
}

.category {
    display: inline-block;
    background-color: #f5f5f5;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-right: 0.5rem;
}

.date {
    color: #666;
    font-size: 0.9rem;
}

/* Tests Page */
.tests-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    padding: 2rem 0;
}

.filters-sidebar {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.filters-sidebar h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #d32f2f;
}

.filter-group {
    margin-bottom: 1rem;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.filter-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.test-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.test-item {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.test-item a {
    text-decoration: none;
    color: inherit;
}

.test-item h2 {
    color: #d32f2f;
    margin-bottom: 0.5rem;
}

.test-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.test-description {
    color: #666;
    margin-top: 0.5rem;
}

/* Test Detail Page */
.test-detail-page {
    padding: 2rem 0;
}

.test-header {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.video-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.youtube-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin-bottom: 1rem;
}

.youtube-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.unlock-section {
    text-align: center;
    padding: 2rem;
    background-color: #f5f5f5;
    border-radius: 8px;
}

.btn-unlock {
    font-size: 1.1rem;
    padding: 0.75rem 2rem;
    margin-top: 1rem;
}

.btn-unlock:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #999;
}

.btn-unlock:disabled:hover {
    background-color: #999;
    transform: none;
}

.results-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.products-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.products-table th {
    background-color: #f5f5f5;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.products-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
}

.products-table tr.winner {
    background-color: #fff3cd;
}

.products-table tr.best-value {
    background-color: #d1ecf1;
}

.product-image {
    max-width: 50px;
    max-height: 50px;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.score {
    font-weight: bold;
    font-size: 1.1rem;
    color: #d32f2f;
}

.badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-winner {
    background-color: #ffc107;
    color: #000;
}

.badge-value {
    background-color: #17a2b8;
    color: white;
}

/* Suggestions Page */
.suggestions-page {
    padding: 2rem 0;
}

.submit-suggestion {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.suggestion-form {
    margin-top: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
    cursor: pointer;
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

.form-group label {
    cursor: pointer;
    display: flex;
    align-items: center;
    user-select: none;
}

.form-group label input[type="checkbox"] {
    margin-right: 0.75rem;
    flex-shrink: 0;
}

/* Checkbox styling - prevent Materialize from creating duplicate styled checkboxes */
input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    cursor: pointer !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    left: 0 !important;
    -webkit-appearance: checkbox !important;
    -moz-appearance: checkbox !important;
    appearance: checkbox !important;
}

/* Hide Materialize's styled checkbox pseudo-elements (::before and ::after only) */
[type="checkbox"]:not(:checked) + span::before,
[type="checkbox"]:checked + span::before,
[type="checkbox"]:not(:checked) + span::after,
[type="checkbox"]:checked + span::after,
input[type="checkbox"] + label::before,
input[type="checkbox"] + label::after {
    display: none !important;
    content: none !important;
}

/* Ensure label text spans are visible (our actual label text) */
label > input[type="checkbox"] + span,
label input[type="checkbox"] + span {
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure checkboxes are visible and not hidden by Materialize */
[type="checkbox"]:not(:checked),
[type="checkbox"]:checked {
    position: relative !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    left: 0 !important;
    visibility: visible !important;
}

input[type="checkbox"].filled-in,
input[type="checkbox"]:not(.filled-in) {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
    left: 0 !important;
}

.form-group textarea {
    resize: vertical;
}

.limit-info {
    padding: 0.75rem;
    background-color: #d1ecf1;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.limit-info.limit-reached {
    background-color: #f8d7da;
    color: #721c24;
}

.filter-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #ddd;
}

.tab {
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab.active {
    color: #d32f2f;
    border-bottom-color: #d32f2f;
}

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.suggestion-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.suggestion-content h3 {
    color: #d32f2f;
    margin-bottom: 0.5rem;
}

.suggestion-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.suggestion-reason {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.suggestion-vote {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vote-count {
    font-weight: 600;
    color: #d32f2f;
}

.btn-vote {
    background-color: #4caf50;
    color: white;
}

.btn-vote:hover {
    background-color: #45a049;
}

/* Admin Pages */
.admin-page {
    padding: 2rem 0;
}

.admin-actions {
    margin-bottom: 2rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-table th {
    background-color: #f5f5f5;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

/* Better column widths for products table */
.admin-page .products-list .admin-table th:nth-child(1),
.admin-page .products-list .admin-table td:nth-child(1) {
    min-width: 150px; /* Navn */
}

.admin-page .products-list .admin-table th:nth-child(2),
.admin-page .products-list .admin-table td:nth-child(2) {
    min-width: 120px; /* Producent */
}

.admin-page .products-list .admin-table th:nth-child(3),
.admin-page .products-list .admin-table td:nth-child(3) {
    min-width: 100px; /* Butik */
}

.admin-page .products-list .admin-table th:nth-child(4),
.admin-page .products-list .admin-table td:nth-child(4) {
    width: 80px; /* Score */
    text-align: center;
}

.admin-page .products-list .admin-table th:nth-child(5),
.admin-page .products-list .admin-table td:nth-child(5) {
    width: 100px; /* Pris */
    text-align: right;
}

.admin-page .products-list .admin-table th:nth-child(6),
.admin-page .products-list .admin-table td:nth-child(6) {
    min-width: 120px; /* Status */
}

.admin-page .products-list .admin-table th:nth-child(7),
.admin-page .products-list .admin-table td:nth-child(7) {
    width: 150px; /* Handlinger */
}

.admin-table .actions {
    display: flex;
    gap: 0.5rem;
}

.btn-edit, .btn-delete, .btn-products, .btn-approve, .btn-reject, .btn-complete {
    padding: 0.25rem 0.75rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: none;
    display: inline-block;
}

.btn-edit {
    background-color: #2196f3;
    color: white;
}

.btn-delete {
    background-color: #f44336;
    color: white;
}

.btn-products {
    background-color: #ff9800;
    color: white;
}

.btn-approve {
    background-color: #4caf50;
    color: white;
}

.btn-reject {
    background-color: #f44336;
    color: white;
}

.btn-complete {
    background-color: #2196f3;
    color: white;
}

.admin-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

.admin-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
}

/* For products page, give more space to the table */
.admin-page .products-list {
    min-width: 0; /* Allow grid item to shrink */
    overflow-x: auto; /* Allow horizontal scrolling if needed */
}

.admin-page .products-list .admin-table {
    min-width: 800px; /* Minimum width for table */
    width: 100%;
}

/* Adjust grid layout for products page to give more space to table */
.admin-page .admin-layout {
    grid-template-columns: 2fr 350px; /* Give more space to products list */
}

.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Footer */
.site-footer {
    background-color: #333;
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

/* Login and Register Forms */
.login-page, .register-page {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.login-page h1, .register-page h1 {
    color: #d32f2f;
    margin-bottom: 1.5rem;
    text-align: center;
}

.login-page h2, .register-page h2 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.login-page h3 {
    font-size: 1rem;
    font-weight: normal;
    margin-bottom: 1.5rem;
    text-align: center;
}

.login-page form, .register-page form {
    margin-top: 2rem;
}

.input-field {
    margin-bottom: 1.5rem;
}

.input-field label {
    color: #666;
    font-size: 0.9rem;
}

.input-field input[type=email]:focus + label,
.input-field input[type=password]:focus + label,
.input-field input[type=text]:focus + label {
    color: #d32f2f;
}

.input-field input[type=email]:focus,
.input-field input[type=password]:focus,
.input-field input[type=text]:focus {
    border-bottom: 1px solid #d32f2f;
    box-shadow: 0 1px 0 0 #d32f2f;
}

.helper-text {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.helper-text[data-error] {
    color: #f44336;
}

.helper-text[data-success] {
    color: #4caf50;
}

input[type=submit], .submit-btn {
    width: 100%;
    padding: 0.75rem;
    background-color: #d32f2f;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1rem;
}

input[type=submit]:hover, .submit-btn:hover {
    background-color: #b71c1c;
}

.error {
    padding: 1rem;
    background-color: #f8d7da;
    color: #721c24;
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 1px solid #f5c6cb;
}

.login-page a, .register-page a {
    color: #d32f2f;
    text-decoration: none;
}

.login-page a:hover, .register-page a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 968px) {
    .header-content {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .main-nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        margin-top: 0.5rem;
        padding-top: 1rem;
        border-top: 1px solid #eee;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .main-nav a {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .user-menu {
        margin-left: auto;
    }
}

@media (max-width: 768px) {
    .tests-layout {
        grid-template-columns: 1fr;
    }
    
    .filters-sidebar {
        position: static;
    }
    
    .admin-layout {
        grid-template-columns: 1fr;
    }
    
    /* On mobile, make products table full width and scrollable */
    .admin-page .products-list {
        overflow-x: auto;
    }
    
    .admin-page .products-list .admin-table {
        min-width: 700px;
    }
    
    .header-content {
        padding: 1rem 0;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .user-menu {
        gap: 0.5rem;
    }
    
    .btn-login, .btn-register {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .login-page, .register-page {
        margin: 1rem;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .main-nav {
        order: 2;
        width: 100%;
        margin-top: 0;
        padding-top: 0.75rem;
        border-top: 1px solid #eee;
    }
    
    .user-menu {
        order: 3;
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid #eee;
    }
    
    .main-nav ul {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }
    
    .main-nav a {
        width: 100%;
        padding: 0.75rem 1rem;
        border-radius: 0;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .main-nav a:first-child {
        border-top: 1px solid #f0f0f0;
    }
}

/* Final Materialize isolation for header - must be last, loads after Materialize */
.site-header nav.main-nav,
.site-header .main-nav {
    background: #fff !important;
    background-color: #fff !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
}

.site-header nav.main-nav ul,
.site-header nav.main-nav .nav-menu,
.site-header .main-nav ul,
.site-header .main-nav .nav-menu {
    display: flex !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    align-items: center !important;
    background: #fff !important;
    background-color: #fff !important;
    border: none !important;
    box-shadow: none !important;
}

.site-header nav.main-nav ul li,
.site-header nav.main-nav .nav-menu li,
.site-header .main-nav ul li,
.site-header .main-nav .nav-menu li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    display: list-item !important;
    background: #fff !important;
    background-color: #fff !important;
    border: none !important;
}

.site-header nav.main-nav a,
.site-header nav.main-nav .nav-menu a,
.site-header .main-nav a,
.site-header .main-nav .nav-menu a {
    color: #333 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    font-size: 0.95rem !important;
    padding: 0.75rem 1.25rem !important;
    display: block !important;
    transition: all 0.2s ease !important;
    border-radius: 6px !important;
    background: #fff !important;
    background-color: #fff !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    cursor: pointer !important;
}

.site-header nav.main-nav a:hover,
.site-header nav.main-nav .nav-menu a:hover,
.site-header .main-nav a:hover,
.site-header .main-nav .nav-menu a:hover {
    color: #d32f2f !important;
    background-color: rgba(211, 47, 47, 0.05) !important;
    text-decoration: none !important;
}

