/*
Theme Name: HiCare
Theme URI: https://hicare.ee
Author: HiCare
Author URI: https://hicare.ee
Description: HiCare teema - kaasaegne ja puhas teema HiCare Panel ja kliendiportaali jaoks.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hicare
Tags: custom-logo, custom-menu, featured-images, full-width-template, translation-ready

HiCare teema on loodud töötama sujuvalt HiCare Panel ja HiCare Client Portal pluginatega.
*/

/* ==========================================================================
   CSS Variables / Custom Properties
   ========================================================================== */

:root {
    /* Colors - Light Theme */
    --hc-primary: #6366f1;
    --hc-primary-hover: #4f46e5;
    --hc-primary-light: #e0e7ff;
    --hc-secondary: #64748b;
    --hc-success: #10b981;
    --hc-success-light: #d1fae5;
    --hc-warning: #f59e0b;
    --hc-warning-light: #fef3c7;
    --hc-danger: #ef4444;
    --hc-danger-light: #fee2e2;
    --hc-info: #3b82f6;
    --hc-info-light: #dbeafe;
    
    /* Background & Surface */
    --hc-bg: #f8fafc;
    --hc-bg-alt: #f1f5f9;
    --hc-surface: #ffffff;
    --hc-surface-hover: #f8fafc;
    
    /* Text */
    --hc-text: #1e293b;
    --hc-text-secondary: #64748b;
    --hc-text-muted: #94a3b8;
    --hc-text-inverse: #ffffff;
    
    /* Borders */
    --hc-border: #e2e8f0;
    --hc-border-focus: #6366f1;
    
    /* Shadows */
    --hc-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --hc-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --hc-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --hc-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Spacing */
    --hc-spacing-xs: 0.25rem;
    --hc-spacing-sm: 0.5rem;
    --hc-spacing-md: 1rem;
    --hc-spacing-lg: 1.5rem;
    --hc-spacing-xl: 2rem;
    --hc-spacing-2xl: 3rem;
    
    /* Border Radius */
    --hc-radius-sm: 0.25rem;
    --hc-radius: 0.5rem;
    --hc-radius-lg: 0.75rem;
    --hc-radius-xl: 1rem;
    --hc-radius-full: 9999px;
    
    /* Typography */
    --hc-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --hc-font-mono: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, 'Courier New', monospace;
    
    /* Font Sizes */
    --hc-text-xs: 0.75rem;
    --hc-text-sm: 0.875rem;
    --hc-text-base: 1rem;
    --hc-text-lg: 1.125rem;
    --hc-text-xl: 1.25rem;
    --hc-text-2xl: 1.5rem;
    --hc-text-3xl: 1.875rem;
    --hc-text-4xl: 2.25rem;
    
    /* Line Heights */
    --hc-leading-tight: 1.25;
    --hc-leading-normal: 1.5;
    --hc-leading-relaxed: 1.625;
    
    /* Transitions */
    --hc-transition-fast: 150ms ease;
    --hc-transition: 200ms ease;
    --hc-transition-slow: 300ms ease;
    
    /* Layout */
    --hc-container-sm: 640px;
    --hc-container-md: 768px;
    --hc-container-lg: 1024px;
    --hc-container-xl: 1280px;
    --hc-container-2xl: 1536px;
    
    /* Header */
    --hc-header-height: 70px;
}

/* Dark Theme */
[data-theme="dark"],
.hc-dark {
    --hc-bg: #0f172a;
    --hc-bg-alt: #1e293b;
    --hc-surface: #1e293b;
    --hc-surface-hover: #334155;
    
    --hc-text: #f1f5f9;
    --hc-text-secondary: #94a3b8;
    --hc-text-muted: #64748b;
    
    --hc-border: #334155;
    
    --hc-primary-light: rgba(99, 102, 241, 0.2);
    --hc-success-light: rgba(16, 185, 129, 0.2);
    --hc-warning-light: rgba(245, 158, 11, 0.2);
    --hc-danger-light: rgba(239, 68, 68, 0.2);
    --hc-info-light: rgba(59, 130, 246, 0.2);
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--hc-font-sans);
    font-size: var(--hc-text-base);
    line-height: var(--hc-leading-normal);
    color: var(--hc-text);
    background-color: var(--hc-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--hc-spacing-md);
    font-weight: 600;
    line-height: var(--hc-leading-tight);
    color: var(--hc-text);
}

h1 { font-size: var(--hc-text-4xl); }
h2 { font-size: var(--hc-text-3xl); }
h3 { font-size: var(--hc-text-2xl); }
h4 { font-size: var(--hc-text-xl); }
h5 { font-size: var(--hc-text-lg); }
h6 { font-size: var(--hc-text-base); }

p {
    margin: 0 0 var(--hc-spacing-md);
}

a {
    color: var(--hc-primary);
    text-decoration: none;
    transition: color var(--hc-transition-fast);
}

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

/* ==========================================================================
   Layout Components
   ========================================================================== */

.hc-container {
    width: 100%;
    max-width: var(--hc-container-xl);
    margin: 0 auto;
    padding: 0 var(--hc-spacing-lg);
}

.hc-container--sm { max-width: var(--hc-container-sm); }
.hc-container--md { max-width: var(--hc-container-md); }
.hc-container--lg { max-width: var(--hc-container-lg); }
.hc-container--2xl { max-width: var(--hc-container-2xl); }

/* ==========================================================================
   Header
   ========================================================================== */

.hc-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--hc-header-height);
    background: var(--hc-surface);
    border-bottom: 1px solid var(--hc-border);
    box-shadow: var(--hc-shadow-sm);
}

.hc-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 var(--hc-spacing-lg);
    max-width: var(--hc-container-2xl);
    margin: 0 auto;
}

.hc-header__logo {
    display: flex;
    align-items: center;
    gap: var(--hc-spacing-sm);
    font-size: var(--hc-text-xl);
    font-weight: 700;
    color: var(--hc-text);
}

.hc-header__logo img {
    height: 40px;
    width: auto;
}

.hc-header__nav {
    display: flex;
    align-items: center;
    gap: var(--hc-spacing-lg);
}

.hc-header__nav-link {
    color: var(--hc-text-secondary);
    font-weight: 500;
    transition: color var(--hc-transition-fast);
}

.hc-header__nav-link:hover,
.hc-header__nav-link.active {
    color: var(--hc-primary);
}

.hc-header__actions {
    display: flex;
    align-items: center;
    gap: var(--hc-spacing-md);
}

/* Mobile Menu Toggle */
.hc-header__menu-toggle {
    display: none;
    padding: var(--hc-spacing-sm);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--hc-text);
}

@media (max-width: 768px) {
    .hc-header__nav {
        display: none;
    }
    
    .hc-header__menu-toggle {
        display: flex;
    }
    
    .hc-header__nav.is-open {
        display: flex;
        position: absolute;
        top: var(--hc-header-height);
        left: 0;
        right: 0;
        flex-direction: column;
        padding: var(--hc-spacing-lg);
        background: var(--hc-surface);
        border-bottom: 1px solid var(--hc-border);
        box-shadow: var(--hc-shadow-md);
    }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.hc-footer {
    padding: var(--hc-spacing-2xl) 0;
    background: var(--hc-surface);
    border-top: 1px solid var(--hc-border);
}

.hc-footer__inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--hc-spacing-xl);
    max-width: var(--hc-container-xl);
    margin: 0 auto;
    padding: 0 var(--hc-spacing-lg);
}

.hc-footer__brand {
    grid-column: span 1;
}

.hc-footer__logo {
    display: flex;
    align-items: center;
    gap: var(--hc-spacing-sm);
    font-size: var(--hc-text-lg);
    font-weight: 700;
    color: var(--hc-text);
    margin-bottom: var(--hc-spacing-md);
}

.hc-footer__description {
    color: var(--hc-text-secondary);
    font-size: var(--hc-text-sm);
}

.hc-footer__column h4 {
    font-size: var(--hc-text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hc-text);
    margin-bottom: var(--hc-spacing-md);
}

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

.hc-footer__links li {
    margin-bottom: var(--hc-spacing-sm);
}

.hc-footer__links a {
    color: var(--hc-text-secondary);
    font-size: var(--hc-text-sm);
}

.hc-footer__links a:hover {
    color: var(--hc-primary);
}

.hc-footer__bottom {
    margin-top: var(--hc-spacing-2xl);
    padding-top: var(--hc-spacing-lg);
    border-top: 1px solid var(--hc-border);
    text-align: center;
    color: var(--hc-text-muted);
    font-size: var(--hc-text-sm);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.hc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--hc-spacing-sm);
    padding: var(--hc-spacing-sm) var(--hc-spacing-lg);
    font-family: inherit;
    font-size: var(--hc-text-sm);
    font-weight: 500;
    line-height: var(--hc-leading-normal);
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--hc-radius);
    cursor: pointer;
    transition: all var(--hc-transition-fast);
}

.hc-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Primary Button */
.hc-btn--primary {
    background: var(--hc-primary);
    color: var(--hc-text-inverse);
}

.hc-btn--primary:hover:not(:disabled) {
    background: var(--hc-primary-hover);
    color: var(--hc-text-inverse);
}

/* Secondary Button */
.hc-btn--secondary {
    background: var(--hc-surface);
    color: var(--hc-text);
    border-color: var(--hc-border);
}

.hc-btn--secondary:hover:not(:disabled) {
    background: var(--hc-surface-hover);
    border-color: var(--hc-text-muted);
}

/* Ghost Button */
.hc-btn--ghost {
    background: transparent;
    color: var(--hc-text-secondary);
}

.hc-btn--ghost:hover:not(:disabled) {
    background: var(--hc-bg-alt);
    color: var(--hc-text);
}

/* Danger Button */
.hc-btn--danger {
    background: var(--hc-danger);
    color: var(--hc-text-inverse);
}

.hc-btn--danger:hover:not(:disabled) {
    background: #dc2626;
}

/* Button Sizes */
.hc-btn--sm {
    padding: var(--hc-spacing-xs) var(--hc-spacing-md);
    font-size: var(--hc-text-xs);
}

.hc-btn--lg {
    padding: var(--hc-spacing-md) var(--hc-spacing-xl);
    font-size: var(--hc-text-base);
}

/* ==========================================================================
   Cards
   ========================================================================== */

.hc-card {
    background: var(--hc-surface);
    border: 1px solid var(--hc-border);
    border-radius: var(--hc-radius-lg);
    box-shadow: var(--hc-shadow-sm);
    overflow: hidden;
}

.hc-card__header {
    padding: var(--hc-spacing-lg);
    border-bottom: 1px solid var(--hc-border);
}

.hc-card__title {
    margin: 0;
    font-size: var(--hc-text-lg);
    font-weight: 600;
}

.hc-card__body {
    padding: var(--hc-spacing-lg);
}

.hc-card__footer {
    padding: var(--hc-spacing-lg);
    border-top: 1px solid var(--hc-border);
    background: var(--hc-bg-alt);
}

/* ==========================================================================
   Forms
   ========================================================================== */

.hc-form-group {
    margin-bottom: var(--hc-spacing-lg);
}

.hc-form-label {
    display: block;
    margin-bottom: var(--hc-spacing-sm);
    font-size: var(--hc-text-sm);
    font-weight: 500;
    color: var(--hc-text);
}

.hc-form-input,
.hc-form-select,
.hc-form-textarea {
    width: 100%;
    padding: var(--hc-spacing-sm) var(--hc-spacing-md);
    font-family: inherit;
    font-size: var(--hc-text-base);
    line-height: var(--hc-leading-normal);
    color: var(--hc-text);
    background: var(--hc-surface);
    border: 1px solid var(--hc-border);
    border-radius: var(--hc-radius);
    transition: border-color var(--hc-transition-fast), box-shadow var(--hc-transition-fast);
}

.hc-form-input:focus,
.hc-form-select:focus,
.hc-form-textarea:focus {
    outline: none;
    border-color: var(--hc-border-focus);
    box-shadow: 0 0 0 3px var(--hc-primary-light);
}

.hc-form-input::placeholder {
    color: var(--hc-text-muted);
}

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

.hc-form-hint {
    margin-top: var(--hc-spacing-xs);
    font-size: var(--hc-text-sm);
    color: var(--hc-text-muted);
}

.hc-form-error {
    margin-top: var(--hc-spacing-xs);
    font-size: var(--hc-text-sm);
    color: var(--hc-danger);
}

/* ==========================================================================
   Alerts
   ========================================================================== */

.hc-alert {
    padding: var(--hc-spacing-md) var(--hc-spacing-lg);
    border-radius: var(--hc-radius);
    font-size: var(--hc-text-sm);
}

.hc-alert--success {
    background: var(--hc-success-light);
    color: #065f46;
    border: 1px solid var(--hc-success);
}

.hc-alert--warning {
    background: var(--hc-warning-light);
    color: #92400e;
    border: 1px solid var(--hc-warning);
}

.hc-alert--danger {
    background: var(--hc-danger-light);
    color: #991b1b;
    border: 1px solid var(--hc-danger);
}

.hc-alert--info {
    background: var(--hc-info-light);
    color: #1e40af;
    border: 1px solid var(--hc-info);
}

/* ==========================================================================
   Badges
   ========================================================================== */

.hc-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: var(--hc-text-xs);
    font-weight: 500;
    border-radius: var(--hc-radius-full);
}

.hc-badge--primary {
    background: var(--hc-primary-light);
    color: var(--hc-primary);
}

.hc-badge--success {
    background: var(--hc-success-light);
    color: var(--hc-success);
}

.hc-badge--warning {
    background: var(--hc-warning-light);
    color: #b45309;
}

.hc-badge--danger {
    background: var(--hc-danger-light);
    color: var(--hc-danger);
}

/* ==========================================================================
   Tables
   ========================================================================== */

.hc-table {
    width: 100%;
    border-collapse: collapse;
}

.hc-table th,
.hc-table td {
    padding: var(--hc-spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--hc-border);
}

.hc-table th {
    font-size: var(--hc-text-sm);
    font-weight: 600;
    color: var(--hc-text-secondary);
    background: var(--hc-bg-alt);
}

.hc-table tbody tr:hover {
    background: var(--hc-surface-hover);
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.hc-text-center { text-align: center; }
.hc-text-right { text-align: right; }
.hc-text-muted { color: var(--hc-text-muted); }
.hc-text-primary { color: var(--hc-primary); }
.hc-text-success { color: var(--hc-success); }
.hc-text-warning { color: var(--hc-warning); }
.hc-text-danger { color: var(--hc-danger); }

.hc-mt-0 { margin-top: 0; }
.hc-mt-1 { margin-top: var(--hc-spacing-sm); }
.hc-mt-2 { margin-top: var(--hc-spacing-md); }
.hc-mt-3 { margin-top: var(--hc-spacing-lg); }
.hc-mt-4 { margin-top: var(--hc-spacing-xl); }

.hc-mb-0 { margin-bottom: 0; }
.hc-mb-1 { margin-bottom: var(--hc-spacing-sm); }
.hc-mb-2 { margin-bottom: var(--hc-spacing-md); }
.hc-mb-3 { margin-bottom: var(--hc-spacing-lg); }
.hc-mb-4 { margin-bottom: var(--hc-spacing-xl); }

.hc-flex { display: flex; }
.hc-flex-col { flex-direction: column; }
.hc-items-center { align-items: center; }
.hc-justify-center { justify-content: center; }
.hc-justify-between { justify-content: space-between; }
.hc-gap-1 { gap: var(--hc-spacing-sm); }
.hc-gap-2 { gap: var(--hc-spacing-md); }
.hc-gap-3 { gap: var(--hc-spacing-lg); }

.hc-hidden { display: none; }
.hc-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ==========================================================================
   WordPress Core Styles Override
   ========================================================================== */

.wp-block-button__link {
    background: var(--hc-primary);
    border-radius: var(--hc-radius);
}

.wp-block-button__link:hover {
    background: var(--hc-primary-hover);
}

/* Hide admin bar spacing when on portal pages */
body.hccp-page-template {
    margin-top: 0 !important;
}

html.hccp-page-template {
    margin-top: 0 !important;
}
/* ==========================================================================
   Logo Image Styles
   ========================================================================== */

.hc-header__logo--image {
    display: flex;
    align-items: center;
}

.hc-header__logo--image img,
.hc-logo-img {
    height: 48px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
}

.hc-footer__logo--image {
    display: flex;
    align-items: center;
}

.hc-footer__logo--image img {
    height: 36px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
}

/* Responsive logo sizes */
@media (max-width: 768px) {
    .hc-header__logo--image img,
    .hc-logo-img {
        height: 40px;
        max-width: 130px;
    }
    
    .hc-footer__logo--image img {
        height: 28px;
        max-width: 100px;
    }
}

@media (max-width: 480px) {
    .hc-header__logo--image img,
    .hc-logo-img {
        height: 36px;
        max-width: 110px;
    }
    
    .hc-footer__logo--image img {
        height: 24px;
        max-width: 85px;
    }
}