/* Google Calendar-inspired styles */

/* Override CSS Variables for Google Calendar Style */
:root {
    /* Google-style spacing */
    --spacing-xs: 2px;
    --spacing-sm: 4px;
    --spacing-md: 8px;
    --spacing-lg: 12px;
    --spacing-xl: 16px;
    
    /* Google-style borders and radius */
    --border-radius-small: 2px;
    --border-radius-medium: 4px;
    --border-radius-large: 8px;
    
    /* Google-style shadows */
    --shadow-sm: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
    --shadow-md: 0 1px 3px 0 rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15);
    --shadow-lg: 0 4px 6px 0 rgba(60,64,67,.3), 0 8px 25px 5px rgba(60,64,67,.15);
}

/* Theme-aware Google style colors - use theme colors but with Google aesthetic */
[data-style="google"] {
    /* Use theme background and text colors */
    --google-bg-primary: var(--background-secondary);
    --google-bg-secondary: var(--background-primary);
    --google-bg-tertiary: var(--background-tertiary);
    --google-text-primary: var(--text-primary);
    --google-text-secondary: var(--text-secondary);
    --google-text-inverse: var(--text-inverse);
    --google-border-primary: var(--border-primary);
    --google-border-secondary: var(--border-secondary);
    --google-accent: var(--primary-color);
    --google-hover-bg: var(--background-tertiary);
    
    /* Google font family */
    font-family: 'Google Sans', 'Roboto', sans-serif;
}

/* Theme-specific accent backgrounds for Google style */
[data-style="google"][data-theme="default"] {
    --google-accent-bg: rgba(102, 126, 234, 0.1);
}

[data-style="google"][data-theme="ocean"] {
    --google-accent-bg: rgba(0, 105, 148, 0.1);
}

[data-style="google"][data-theme="forest"] {
    --google-accent-bg: rgba(6, 95, 70, 0.1);
}

[data-style="google"][data-theme="sunset"] {
    --google-accent-bg: rgba(234, 88, 12, 0.1);
}

[data-style="google"][data-theme="purple"] {
    --google-accent-bg: rgba(124, 58, 237, 0.1);
}

[data-style="google"][data-theme="dark"] {
    --google-accent-bg: rgba(55, 65, 81, 0.3);
}

[data-style="google"][data-theme="rose"] {
    --google-accent-bg: rgba(225, 29, 72, 0.1);
}

[data-style="google"][data-theme="mint"] {
    --google-accent-bg: rgba(16, 185, 129, 0.1);
}

[data-style="google"][data-theme="midnight"] {
    --google-accent-bg: rgba(76, 154, 255, 0.15);
}

[data-style="google"][data-theme="charcoal"] {
    --google-accent-bg: rgba(74, 222, 128, 0.15);
}

[data-style="google"][data-theme="nord"] {
    --google-accent-bg: rgba(136, 192, 208, 0.15);
}

[data-style="google"][data-theme="dracula"] {
    --google-accent-bg: rgba(189, 147, 249, 0.15);
}

/* Google-style sidebar */
[data-style="google"] .app-sidebar {
    background: var(--google-bg-primary);
    border-right: 1px solid var(--google-border-primary);
    font-family: 'Google Sans', 'Roboto', sans-serif;
    box-shadow: 2px 0 8px rgba(60,64,67,.1);
}

[data-style="google"] .sidebar-header {
    background: transparent;
    border-bottom: 1px solid var(--google-border-primary);
}

[data-style="google"] .sidebar-header h1 {
    font-size: 20px;
    font-weight: 500;
    color: var(--google-text-primary);
    font-family: 'Google Sans', 'Roboto', sans-serif;
}

[data-style="google"] .user-info {
    color: var(--google-text-primary);
}

[data-style="google"] .user-info .username {
    font-weight: 500;
    color: var(--google-text-primary);
}

[data-style="google"] .user-info .server-url {
    color: var(--google-text-secondary);
}

/* Google-style buttons */
[data-style="google"] .create-calendar-button {
    background: var(--google-accent);
    color: var(--google-text-inverse);
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}

[data-style="google"] .create-calendar-button:hover {
    box-shadow: var(--shadow-md);
}

[data-style="google"] .logout-button {
    background: transparent;
    color: var(--google-accent);
    border: 1px solid var(--google-border-primary);
    border-radius: 4px;
    padding: 8px 16px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

[data-style="google"] .logout-button:hover {
    background: var(--google-hover-bg);
}

/* Google-style navigation */
[data-style="google"] .sidebar-nav .nav-link {
    color: var(--google-text-primary);
    text-decoration: none;
}

[data-style="google"] .sidebar-nav .nav-link:hover {
    color: var(--google-accent);
    background: var(--google-hover-bg);
}

/* Calendar list styling */
[data-style="google"] .calendar-list h3 {
    color: var(--google-text-primary);
}

[data-style="google"] .calendar-list .calendar-name {
    color: var(--google-text-primary);
}

[data-style="google"] .no-calendars {
    color: var(--google-text-secondary);
}

/* Form labels and text */
[data-style="google"] .sidebar-footer label,
[data-style="google"] .view-selector label,
[data-style="google"] .theme-selector label,
[data-style="google"] .style-selector label {
    color: var(--google-text-primary);
}

/* Google-style selectors */
[data-style="google"] .view-selector-dropdown,
[data-style="google"] .theme-selector-dropdown,
[data-style="google"] .style-selector-dropdown {
    border: 1px solid var(--google-border-primary);
    border-radius: 4px;
    padding: 8px;
    font-size: 14px;
    color: var(--google-text-primary);
    background: var(--google-bg-primary);
    font-family: inherit;
}

[data-style="google"] .view-selector-dropdown:focus,
[data-style="google"] .theme-selector-dropdown:focus,
[data-style="google"] .style-selector-dropdown:focus {
    outline: none;
    border-color: var(--google-accent);
    box-shadow: 0 0 0 2px rgba(26,115,232,.2);
}

/* Google-style calendar list items */
[data-style="google"] .calendar-list h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--google-text-primary);
    margin-bottom: 8px;
}

[data-style="google"] .calendar-list ul {
    list-style: none;
}

[data-style="google"] .calendar-list .calendar-item {
    padding: 4px 0;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

[data-style="google"] .calendar-list .calendar-item:hover {
    background-color: var(--google-hover-bg);
}

[data-style="google"] .calendar-list .calendar-name {
    color: var(--google-text-primary);
    font-size: 14px;
    font-weight: 400;
}

/* Google-style main content area */
[data-style="google"] .app-main {
    background: var(--google-bg-primary);
    font-family: 'Google Sans', 'Roboto', sans-serif;
    color: var(--google-text-primary);
}

/* Calendar header elements */
[data-style="google"] .calendar-header {
    background: var(--google-bg-secondary);
    color: var(--google-text-primary);
}

[data-style="google"] .calendar-header h2,
[data-style="google"] .calendar-header h3,
[data-style="google"] .month-header,
[data-style="google"] .week-header {
    color: var(--google-text-primary);
    font-family: 'Google Sans', 'Roboto', sans-serif;
}

/* Month name and title */
[data-style="google"] h1,
[data-style="google"] h2, 
[data-style="google"] h3,
[data-style="google"] .month-title,
[data-style="google"] .calendar-title,
[data-style="google"] .current-month,
[data-style="google"] .month-year,
[data-style="google"] .header-title {
    color: var(--google-text-primary);
    font-family: 'Google Sans', 'Roboto', sans-serif;
}

/* Navigation arrows and buttons */
[data-style="google"] button,
[data-style="google"] .nav-button,
[data-style="google"] .calendar-nav-button,
[data-style="google"] .prev-button,
[data-style="google"] .next-button,
[data-style="google"] .arrow-button {
    color: var(--google-text-primary);
    background: var(--google-bg-secondary);
    border: 1px solid var(--google-border-primary);
    border-radius: 4px;
}

[data-style="google"] button:hover,
[data-style="google"] .nav-button:hover,
[data-style="google"] .calendar-nav-button:hover,
[data-style="google"] .prev-button:hover,
[data-style="google"] .next-button:hover,
[data-style="google"] .arrow-button:hover {
    background: var(--google-accent-bg);
    color: var(--google-accent);
    border-color: var(--google-accent);
}

/* Calendar controls and date display */
[data-style="google"] .calendar-controls,
[data-style="google"] .current-date,
[data-style="google"] .date-display {
    color: var(--google-text-primary);
}

/* Google-style calendar grid */
[data-style="google"] .calendar-grid,
[data-style="google"] .calendar-container {
    border: 1px solid var(--google-border-primary);
    border-radius: 8px;
    overflow: hidden;
    background: var(--google-bg-primary);
    box-shadow: var(--shadow-md);
    font-family: 'Google Sans', 'Roboto', sans-serif;
}

[data-style="google"] .calendar-header {
    background: var(--google-bg-secondary);
    border-bottom: 1px solid var(--google-border-primary);
    padding: 16px;
}

[data-style="google"] .month-header,
[data-style="google"] .week-header {
    font-size: 22px;
    font-weight: 400;
    color: var(--google-text-primary);
    font-family: 'Google Sans', 'Roboto', sans-serif;
}

/* Google-style calendar cells */
[data-style="google"] .calendar-day,
[data-style="google"] .day-cell {
    border: 1px solid var(--google-border-secondary);
    background: var(--google-bg-primary);
    transition: background-color 0.15s ease;
    padding: 8px;
    min-height: 120px;
    position: relative;
}

[data-style="google"] .calendar-day:hover,
[data-style="google"] .day-cell:hover {
    background: var(--google-hover-bg);
    box-shadow: inset 0 0 0 1px var(--google-border-primary);
}

[data-style="google"] .calendar-day.today,
[data-style="google"] .day-cell.today {
    background: var(--google-accent-bg);
    border-color: var(--google-accent);
}

[data-style="google"] .calendar-day.other-month,
[data-style="google"] .day-cell.other-month {
    background: var(--google-bg-tertiary);
    color: var(--google-text-secondary);
}

[data-style="google"] .day-number,
[data-style="google"] .date-number {
    font-size: 14px;
    font-weight: 500;
    color: var(--google-text-primary);
    margin-bottom: 4px;
    font-family: 'Google Sans', 'Roboto', sans-serif;
}

/* Day headers (Mon, Tue, Wed, etc.) */
[data-style="google"] .day-header,
[data-style="google"] .weekday-header {
    background: var(--google-bg-secondary);
    color: var(--google-text-secondary);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 8px;
    border-bottom: 1px solid var(--google-border-primary);
    font-family: 'Google Sans', 'Roboto', sans-serif;
}

/* Google Calendar-style events */
[data-style="google"] .event {
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 400;
    margin: 1px 0 2px 0;
    cursor: pointer;
    border: none;
    color: white;
    font-family: 'Google Sans', 'Roboto', sans-serif;
    box-shadow: 0 1px 3px rgba(60,64,67,.3);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    display: block;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    line-height: 1.3;
}

[data-style="google"] .event * {
    color: white;
    font-family: inherit;
}

[data-style="google"] .event:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(60,64,67,.4);
}

/* All-day events styling */
[data-style="google"] .event.all-day {
    border-radius: 12px;
    padding: 4px 12px;
    font-weight: 500;
    margin: 2px 0;
}

/* Event time display */
[data-style="google"] .event-time {
    opacity: 0.9;
    font-size: 10px;
    margin-right: 4px;
}

/* Week view events */
[data-style="google"] .week-view .event {
    border-left: 3px solid rgba(255,255,255,0.8);
    border-radius: 0 4px 4px 0;
    padding-left: 6px;
}

/* Calendar table structure */
[data-style="google"] .calendar-table,
[data-style="google"] table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    background: var(--google-bg-primary);
}

[data-style="google"] .calendar-table td,
[data-style="google"] table td {
    vertical-align: top;
    border: 1px solid var(--google-border-secondary);
    background: var(--google-bg-primary);
}

/* Month/Week view toggle */
[data-style="google"] .view-toggle {
    display: flex;
    gap: 4px;
    background: var(--google-bg-tertiary);
    border-radius: 6px;
    padding: 2px;
}

[data-style="google"] .view-toggle button {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--google-text-secondary);
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

[data-style="google"] .view-toggle button.active {
    background: var(--google-bg-primary);
    color: var(--google-accent);
    box-shadow: var(--shadow-sm);
}

/* Today button */
[data-style="google"] .today-button {
    background: var(--google-bg-primary);
    border: 1px solid var(--google-border-primary);
    color: var(--google-accent);
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

[data-style="google"] .today-button:hover {
    background: var(--google-hover-bg);
    border-color: var(--google-accent);
}

/* Google-style modals */
[data-style="google"] .modal-overlay {
    background: rgba(0, 0, 0, 0.5);
}

[data-style="google"] .modal-content {
    background: var(--google-bg-primary);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    border: none;
    color: var(--google-text-primary);
}

[data-style="google"] .modal h2 {
    font-size: 20px;
    font-weight: 500;
    color: var(--google-text-primary);
    font-family: 'Google Sans', sans-serif;
}

/* Google-style form inputs */
[data-style="google"] input[type="text"],
[data-style="google"] input[type="email"],
[data-style="google"] input[type="password"],
[data-style="google"] input[type="url"],
[data-style="google"] input[type="date"],
[data-style="google"] input[type="time"],
[data-style="google"] textarea,
[data-style="google"] select {
    border: 1px solid var(--google-border-primary);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--google-text-primary);
    background: var(--google-bg-primary);
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

[data-style="google"] input:focus,
[data-style="google"] textarea:focus,
[data-style="google"] select:focus {
    outline: none;
    border-color: var(--google-accent);
    box-shadow: 0 0 0 2px rgba(26,115,232,.2);
}

/* Google-style labels */
[data-style="google"] label {
    font-size: 14px;
    font-weight: 500;
    color: var(--google-text-primary);
    margin-bottom: 4px;
    display: block;
}

/* Dark theme shadow adjustments */
[data-style="google"][data-theme="dark"] .calendar-grid,
[data-style="google"][data-theme="dark"] .calendar-container {
    box-shadow: 0 1px 3px 0 rgba(0,0,0,.3), 0 4px 8px 3px rgba(0,0,0,.15);
}

[data-style="google"][data-theme="dark"] .event {
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

[data-style="google"][data-theme="dark"] .event:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,.4);
}