/*
Theme Name: Startpagina Theme
Theme URI: https://autisme.wiki
Description: Professional multi-column startpage theme
Version: 2.0
Author: Quinten de Graaf
Author URI: https://example.com
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: startpagina-theme
*/

/* ============================================================================
   CSS VARIABLES - Easy color customization
   ============================================================================ */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #3b82f6;
    
    /* Category header colors - adjust these for different looks */
    --category-1: #4a7ba7;  /* Blue */
    --category-2: #8b5e3c;  /* Brown */
    --category-3: #2d5016;  /* Green */
    --category-4: #d97706;  /* Orange */
    
    --featured-bg: #fef3c7;
    --featured-border: #fbbf24;
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --border-color: #e5e7eb;
    --bg-light: #f9fafb;
    --white: #ffffff;
    
    --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-dark);
    background: var(--bg-light);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

/* ============================================================================
   CONTAINER & LAYOUT
   ============================================================================ */
.sp-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.sp-page-header {
    margin-bottom: 20px;
    padding: 20px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.sp-page-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.sp-page-intro {
    color: var(--text-gray);
    font-size: 16px;
}

/* ============================================================================
   GRID LAYOUT - Responsive columns
   ============================================================================ */
.sp-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* On larger screens, force 3-4 columns */
@media (min-width: 1200px) {
    .sp-categories-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .sp-categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .sp-categories-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   CATEGORY BLOCKS
   ============================================================================ */
.sp-category {
    background: var(--white);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sp-category-header {
    padding: 12px 16px;
    color: var(--white);
    font-weight: 600;
    font-size: 15px;
    background: var(--primary-color);
}

/* Alternating category colors */
.sp-category:nth-child(4n+1) .sp-category-header {
    background: var(--category-1);
}

.sp-category:nth-child(4n+2) .sp-category-header {
    background: var(--category-2);
}

.sp-category:nth-child(4n+3) .sp-category-header {
    background: var(--category-3);
}

.sp-category:nth-child(4n+4) .sp-category-header {
    background: var(--category-4);
}

.sp-category-description {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-gray);
    background: #fafafa;
    border-bottom: 1px solid var(--border-color);
}

.sp-category-links {
    padding: 8px 0;
    flex: 1;
}

/* ============================================================================
   LINKS - Compact list style
   ============================================================================ */
.sp-link-item {
    padding: 8px 16px;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s;
}

.sp-link-item:hover {
    background: #f9fafb;
}

.sp-link-item:last-child {
    border-bottom: none;
}

/* Featured links - highlighted */
.sp-link-item.featured {
    background: var(--featured-bg);
    border-left: 3px solid var(--featured-border);
}

.sp-link-item.featured:hover {
    background: #fef3c7;
}

.sp-link-title {
    font-weight: 500;
    font-size: 14px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.sp-link-title:hover {
    color: var(--primary-dark);
}

/* Featured star icon */
.sp-link-item.featured .sp-link-title::before {
    content: '⭐';
    font-size: 12px;
}

.sp-link-description {
    font-size: 12px;
    color: var(--text-gray);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sp-link-anchor {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

/* ============================================================================
   FOOTER SECTION
   ============================================================================ */
.sp-page-footer {
    margin-top: 20px;
    padding: 20px;
    background: var(--white);
    border-radius: 8px;
    text-align: center;
    color: var(--text-gray);
    font-size: 14px;
}

/* ============================================================================
   OVERVIEW PAGE (All pages listing)
   ============================================================================ */
.sp-pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.sp-page-card {
    background: var(--white);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.sp-page-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.sp-page-card-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.sp-page-card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-gray);
    margin-top: 12px;
}

.sp-page-card-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============================================================================
   SUBMIT FORM
   ============================================================================ */
.sp-submit-form {
    max-width: 600px;
    margin: 0 auto;
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

.sp-form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-dark);
}

.sp-form-label.required::after {
    content: ' *';
    color: #ef4444;
}

.sp-form-input,
.sp-form-textarea,
.sp-form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--font-main);
    transition: border-color 0.2s;
}

.sp-form-input:focus,
.sp-form-textarea:focus,
.sp-form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.sp-form-textarea {
    resize: vertical;
    min-height: 100px;
}

.sp-form-help {
    font-size: 12px;
    color: var(--text-gray);
    margin-top: 4px;
}

.sp-form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sp-form-checkbox input {
    width: auto;
}

.sp-form-submit {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 12px 32px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.sp-form-submit:hover {
    background: var(--primary-dark);
}

/* ============================================================================
   ALERTS & MESSAGES
   ============================================================================ */
.sp-alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.sp-alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.sp-alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.sp-alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* ============================================================================
   PRICING INFO
   ============================================================================ */
.sp-pricing-info {
    background: var(--bg-light);
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.sp-pricing-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.sp-pricing-row:last-child {
    border-bottom: none;
    font-weight: 600;
    font-size: 16px;
}

/* ============================================================================
   SEARCH
   ============================================================================ */
.sp-search-form {
    max-width: 600px;
    margin: 0 auto 30px;
}

.sp-search-input-wrapper {
    display: flex;
    gap: 10px;
}

.sp-search-input {
    flex: 1;
}

.sp-search-button {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.sp-search-button:hover {
    background: var(--primary-dark);
}

.sp-search-results {
    margin-top: 30px;
}

.sp-search-result-item {
    background: var(--white);
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================ */
@media (max-width: 768px) {
    .sp-container {
        padding: 10px;
    }
    
    .sp-page-title {
        font-size: 24px;
    }
    
    .sp-page-header {
        padding: 16px;
    }
    
    .sp-submit-form {
        padding: 20px;
    }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */
.sp-text-center {
    text-align: center;
}

.sp-text-muted {
    color: var(--text-gray);
}

.sp-mb-0 { margin-bottom: 0; }
.sp-mb-10 { margin-bottom: 10px; }
.sp-mb-20 { margin-bottom: 20px; }
.sp-mt-20 { margin-top: 20px; }

/* ============================================================================
   PRINT STYLES
   ============================================================================ */
@media print {
    .sp-submit-form,
    .sp-search-form,
    .sp-form-submit {
        display: none;
    }
    
    .sp-category {
        break-inside: avoid;
    }
}
