/*
Theme Name: TopPraktijk Dashboard
Theme URI: https://toppraktijk.com
Author: TopPraktijk
Description: A clean dashboard theme for viewing marketing insights with the signature teal styling from TopPraktijk email templates.
Version: 1.0.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: toppraktijk-dashboard
*/

/* ========================================
   TOPPRAKTIJK DASHBOARD THEME
   Marketing Insights Dashboard
   ======================================== */

/* CSS Variables - Email Template Colors */
:root {
    --tp-primary: #07ab9f;
    --tp-primary-dark: #05988d;
    --tp-primary-light: #9adcd5;
    --tp-cream: #feffea;
    --tp-cream-dark: #f1f2de;
    --tp-text-dark: #0a0908;
    --tp-text-muted: #636363;
    --tp-white: #ffffff;
    --tp-border: #e0e0e0;
    --tp-success: #22c55e;
    --tp-warning: #f59e0b;
    --tp-error: #ef4444;
    --tp-radius: 12px;
    --tp-radius-sm: 8px;
    --tp-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --tp-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--tp-primary) 0%, #0a8f85 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: var(--tp-text-dark);
    line-height: 1.6;
}

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

/* Header Section */
.tp-header {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 30px;
}

.tp-header__logo {
    max-width: 180px;
    margin-bottom: 20px;
}

.tp-header__title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--tp-cream);
    margin: 0 0 10px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tp-header__subtitle {
    font-size: 1.1rem;
    color: rgba(254, 255, 234, 0.9);
    margin: 0;
}

/* Main Dashboard Card */
.tp-card {
    background: var(--tp-cream);
    border-radius: var(--tp-radius);
    box-shadow: var(--tp-shadow-lg);
    overflow: hidden;
    margin-bottom: 30px;
}

.tp-card__header {
    background: var(--tp-white);
    padding: 24px 30px;
    border-bottom: 1px solid var(--tp-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.tp-card__title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--tp-text-dark);
    margin: 0;
}

.tp-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--tp-text-muted);
}

.tp-card__meta-icon {
    color: var(--tp-primary);
}

/* Stats Grid */
.tp-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 30px;
}

.tp-stat {
    background: var(--tp-white);
    border-radius: var(--tp-radius-sm);
    padding: 24px;
    text-align: center;
    box-shadow: var(--tp-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.tp-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--tp-shadow-lg);
}

.tp-stat__icon {
    width: 48px;
    height: 48px;
    background: var(--tp-primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: var(--tp-primary);
    font-size: 24px;
}

.tp-stat__label {
    font-size: 0.875rem;
    color: var(--tp-text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tp-stat__value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--tp-text-dark);
    margin: 0;
    line-height: 1.2;
}

.tp-stat__change {
    font-size: 0.875rem;
    margin-top: 8px;
}

.tp-stat__change--positive {
    color: var(--tp-success);
}

.tp-stat__change--negative {
    color: var(--tp-error);
}

/* Hero Stats Section (Email Style) */
.tp-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: var(--tp-primary);
    color: var(--tp-cream);
}

@media (max-width: 768px) {
    .tp-hero {
        grid-template-columns: 1fr;
    }
}

.tp-hero__content {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tp-hero__account {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 4px 0;
}

.tp-hero__report-type {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0 0 20px 0;
}

.tp-hero__date-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    width: fit-content;
}

.tp-hero__stat {
    background: var(--tp-primary-light);
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--tp-text-dark);
}

.tp-hero__stat-label {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--tp-text-muted);
}

.tp-hero__stat-value {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--tp-text-dark);
    margin: 0;
    line-height: 1;
}

/* Tables Section */
.tp-section {
    padding: 30px;
    border-bottom: 1px solid var(--tp-border);
}

.tp-section:last-child {
    border-bottom: none;
}

.tp-section__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.tp-section__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--tp-text-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tp-section__title-icon {
    color: var(--tp-primary);
}

/* Custom Table Styling */
.tp-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9375rem;
}

.tp-table th {
    background: var(--tp-cream-dark);
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--tp-text-muted);
    border-bottom: 2px solid var(--tp-border);
}

.tp-table th:last-child {
    text-align: right;
}

.tp-table td {
    padding: 16px;
    border-bottom: 1px solid var(--tp-border);
    vertical-align: middle;
}

.tp-table td:last-child {
    text-align: right;
    font-weight: 600;
}

.tp-table tr:last-child td {
    border-bottom: none;
}

.tp-table tr:hover td {
    background: rgba(7, 171, 159, 0.03);
}

.tp-table__total {
    background: var(--tp-cream-dark) !important;
    font-weight: 700 !important;
}

.tp-table__total td {
    border-top: 2px solid var(--tp-border);
    border-bottom: none !important;
}

/* Progress Bars */
.tp-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tp-progress__bar {
    flex: 1;
    height: 8px;
    background: var(--tp-cream-dark);
    border-radius: 4px;
    overflow: hidden;
}

.tp-progress__fill {
    height: 100%;
    background: var(--tp-primary);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.tp-progress__value {
    font-weight: 600;
    min-width: 40px;
    text-align: right;
}

/* Charts Container */
.tp-chart-container {
    background: var(--tp-white);
    border-radius: var(--tp-radius-sm);
    padding: 24px;
    box-shadow: var(--tp-shadow);
}

/* Buttons */
.tp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    border: none;
    border-radius: var(--tp-radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.tp-btn--primary {
    background: var(--tp-primary);
    color: var(--tp-white);
}

.tp-btn--primary:hover {
    background: var(--tp-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--tp-shadow);
}

.tp-btn--secondary {
    background: var(--tp-white);
    color: var(--tp-primary);
    border: 2px solid var(--tp-primary);
}

.tp-btn--secondary:hover {
    background: var(--tp-primary);
    color: var(--tp-white);
}

/* Select Dropdowns */
.tp-select {
    appearance: none;
    background: var(--tp-white);
    border: 2px solid var(--tp-border);
    border-radius: var(--tp-radius-sm);
    padding: 10px 40px 10px 16px;
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--tp-text-dark);
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2307ab9f' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    min-width: 180px;
}

.tp-select:focus {
    outline: none;
    border-color: var(--tp-primary);
}

/* Loading State */
.tp-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.tp-loading__spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--tp-cream-dark);
    border-top-color: var(--tp-primary);
    border-radius: 50%;
    animation: tp-spin 0.8s linear infinite;
}

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

.tp-loading__text {
    margin-top: 16px;
    color: var(--tp-text-muted);
    font-size: 0.9375rem;
}

/* Error State */
.tp-error {
    background: #fef2f2;
    border-left: 4px solid var(--tp-error);
    padding: 16px 20px;
    border-radius: var(--tp-radius-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    color: #991b1b;
}

.tp-error__icon {
    color: var(--tp-error);
    font-size: 20px;
}

/* Empty State */
.tp-empty {
    text-align: center;
    padding: 60px 20px;
}

.tp-empty__icon {
    font-size: 48px;
    color: var(--tp-primary-light);
    margin-bottom: 16px;
}

.tp-empty__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--tp-text-dark);
    margin: 0 0 8px 0;
}

.tp-empty__text {
    color: var(--tp-text-muted);
    margin: 0;
}

/* Footer */
.tp-footer {
    text-align: center;
    padding: 30px 20px;
    color: rgba(254, 255, 234, 0.7);
    font-size: 0.875rem;
}

.tp-footer a {
    color: var(--tp-cream);
    text-decoration: underline;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .tp-dashboard {
        padding: 10px;
    }
    
    .tp-header__title {
        font-size: 1.75rem;
    }
    
    .tp-card__header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tp-stats {
        grid-template-columns: repeat(2, 1fr);
        padding: 20px;
        gap: 12px;
    }
    
    .tp-stat {
        padding: 16px;
    }
    
    .tp-stat__value {
        font-size: 1.5rem;
    }
    
    .tp-section {
        padding: 20px;
    }
    
    .tp-table {
        font-size: 0.875rem;
    }
    
    .tp-table th,
    .tp-table td {
        padding: 12px;
    }
    
    .tp-hero__content,
    .tp-hero__stat {
        padding: 24px;
    }
    
    .tp-hero__stat-value {
        font-size: 2.5rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .tp-dashboard {
        max-width: 100%;
    }
    
    .tp-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Animations */
@keyframes tp-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tp-card {
    animation: tp-fade-in 0.4s ease-out;
}

.tp-stat {
    animation: tp-fade-in 0.4s ease-out;
    animation-fill-mode: both;
}

.tp-stat:nth-child(1) { animation-delay: 0.05s; }
.tp-stat:nth-child(2) { animation-delay: 0.1s; }
.tp-stat:nth-child(3) { animation-delay: 0.15s; }
.tp-stat:nth-child(4) { animation-delay: 0.2s; }

/* ========================================
   REGULAR PAGE CONTENT STYLING
   For homepage, posts, pages (non-dashboard)
   ======================================== */

/* Site wrapper for regular pages */
.site {
    background: var(--tp-cream);
    min-height: 100vh;
}

/* Main content area */
.site-main {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Entry/article styling */
.entry-content {
    background: var(--tp-white);
    border-radius: var(--tp-radius);
    padding: 40px;
    box-shadow: var(--tp-shadow);
}

/* Plain content - no box styling for homepage */
.entry-content--plain {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    padding: 20px 0;
}

/* Typography for content */
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    color: var(--tp-text-dark);
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 20px;
    line-height: 1.3;
}

.entry-content h1 {
    font-size: 2rem;
    color: var(--tp-primary);
}

.entry-content h2 {
    font-size: 1.75rem;
}

.entry-content h3 {
    font-size: 1.5rem;
}

.entry-content p {
    margin-bottom: 20px;
    color: var(--tp-text-dark);
    line-height: 1.8;
}

.entry-content a {
    color: var(--tp-primary);
    text-decoration: underline;
    transition: color 0.2s;
}

.entry-content a:hover {
    color: var(--tp-primary-dark);
}

.entry-content ul,
.entry-content ol {
    margin-bottom: 20px;
    padding-left: 30px;
}

.entry-content li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.entry-content blockquote {
    border-left: 4px solid var(--tp-primary);
    background: var(--tp-cream-dark);
    padding: 20px 25px;
    margin: 20px 0;
    font-style: italic;
    color: var(--tp-text-muted);
    border-radius: 0 var(--tp-radius-sm) var(--tp-radius-sm) 0;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--tp-radius-sm);
}

/* Plain content typography adjustments */
.entry-content--plain h1 {
    margin-top: 0;
}

.entry-content--plain > *:first-child {
    margin-top: 0;
}

/* Page header (for regular pages) */
.page-header {
    text-align: center;
    padding: 60px 20px 40px;
    max-width: 800px;
    margin: 0 auto;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--tp-primary);
    margin: 0;
}

/* Site header adjustments for regular pages */
body:not(.single-tpd_dashboard) .tp-site-header {
    background: var(--tp-primary);
}

body:not(.single-tpd_dashboard) .tp-header {
    padding: 60px 20px 40px;
}

/* Responsive adjustments for content */
@media (max-width: 768px) {
    .site-main {
        padding: 15px;
    }
    
    .entry-content {
        padding: 25px;
    }
    
    .entry-content--plain {
        padding: 15px 0;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
    
    .entry-content h1 {
        font-size: 1.5rem;
    }
    
    .entry-content h2 {
        font-size: 1.25rem;
    }
    
    .entry-content h3 {
        font-size: 1.1rem;
    }
}
