/**
 * 3task Calendar Admin Styles v1.3
 *
 * @package 3task Calendar
 * @since 1.0.0
 */

/* Reset */
.threecal-wrap {
    margin: 0;
    padding: 0;
    max-width: 100%;
}

.threecal-wrap * {
    box-sizing: border-box;
}

/* Header */
.threecal-header {
    background: #fff;
    padding: 16px 24px;
    margin: -10px -20px 0 -20px;
    border-bottom: 1px solid #e1e5eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.threecal-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.threecal-logo h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2563eb;
    margin: 0;
    padding: 0;
}

.threecal-logo-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    color: #2563eb;
}

.threecal-version {
    font-size: 0.75rem;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
}

.threecal-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.threecal-header-actions .button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    height: auto;
}

.threecal-header-actions .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Tabs Navigation */
.threecal-tabs {
    background: #fff;
    margin: 0 -20px;
    padding: 0 24px;
    border-bottom: 1px solid #e1e5eb;
    display: flex;
    gap: 0;
    overflow-x: auto;
}

.threecal-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 14px 18px;
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.threecal-tab .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.threecal-tab:hover {
    color: #2563eb;
    background: #f9fafb;
}

.threecal-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background: transparent;
}

/* Content */
.threecal-content {
    padding: 24px 0;
}

/* Cards */
.threecal-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    padding: 24px;
    margin-bottom: 20px;
}

.threecal-card h3 {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a2e;
}

/* Stats Grid */
.threecal-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .threecal-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.threecal-stat-card {
    background: #fff;
    padding: 20px 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
}

.threecal-stat-card .stat-label {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 6px;
}

.threecal-stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a2e;
}

.threecal-stat-card.success .stat-value { color: #059669; }
.threecal-stat-card.warning .stat-value { color: #d97706; }
.threecal-stat-card.danger .stat-value { color: #dc2626; }

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
    --cc-primary: #6366f1;
    --cc-primary-light: #818cf8;
    --cc-primary-dark: #4f46e5;
    --cc-secondary: #ec4899;
    --cc-accent: #06b6d4;
    --cc-success: #10b981;
    --cc-warning: #f59e0b;
    --cc-danger: #ef4444;

    --cc-bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --cc-card-bg: #ffffff;
    --cc-border: #e5e7eb;
    --cc-text: #1f2937;
    --cc-text-light: #6b7280;
    --cc-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --cc-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --cc-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    --cc-radius: 12px;
    --cc-radius-sm: 8px;
    --cc-radius-lg: 16px;
    --cc-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Base Admin Styles
   ========================================================================== */
.threecal-admin {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.threecal-admin h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--cc-text);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.threecal-admin h1::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 32px;
    background: var(--cc-bg-gradient);
    border-radius: 3px;
}

.threecal-admin .page-title-action {
    background: var(--cc-bg-gradient);
    border: none;
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--cc-radius-sm);
    font-weight: 500;
    text-decoration: none;
    transition: var(--cc-transition);
    box-shadow: var(--cc-shadow);
}

.threecal-admin .page-title-action:hover {
    transform: translateY(-2px);
    box-shadow: var(--cc-shadow-lg);
    color: #fff;
}

/* ==========================================================================
   Cards
   ========================================================================== */
.threecal-card {
    background: var(--cc-card-bg);
    border-radius: var(--cc-radius-lg);
    box-shadow: var(--cc-shadow);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--cc-border);
    transition: var(--cc-transition);
}

.threecal-card:hover {
    box-shadow: var(--cc-shadow-lg);
}

.threecal-card h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--cc-text);
    margin: 0 0 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--cc-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.threecal-card h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 20px;
    background: var(--cc-bg-gradient);
    border-radius: 2px;
}

/* ==========================================================================
   Meta Boxes (Sidebar)
   ========================================================================== */
.threecal-meta-box {
    background: var(--cc-card-bg);
    border-radius: var(--cc-radius);
    box-shadow: var(--cc-shadow);
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid var(--cc-border);
}

.threecal-meta-box h3 {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    margin: 0;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--cc-text);
    border-bottom: 1px solid var(--cc-border);
}

.threecal-meta-box-content {
    padding: 16px;
}

/* ==========================================================================
   Form Fields
   ========================================================================== */
.threecal-field {
    margin-bottom: 20px;
}

.threecal-field label {
    display: block;
    font-weight: 500;
    color: var(--cc-text);
    margin-bottom: 8px;
    font-size: 14px;
}

.threecal-field label .required {
    color: var(--cc-danger);
}

.threecal-field input[type="text"],
.threecal-field input[type="email"],
.threecal-field input[type="url"],
.threecal-field input[type="tel"],
.threecal-field input[type="number"],
.threecal-field input[type="datetime-local"],
.threecal-field select,
.threecal-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--cc-border);
    border-radius: var(--cc-radius-sm);
    font-size: 14px;
    color: var(--cc-text);
    background: #fff;
    transition: var(--cc-transition);
}

.threecal-field input:focus,
.threecal-field select:focus,
.threecal-field textarea:focus {
    outline: none;
    border-color: var(--cc-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.threecal-field-row {
    display: flex;
    gap: 16px;
}

.threecal-field-half {
    flex: 1;
}

.threecal-field-third {
    flex: 0 0 33%;
}

.threecal-field-two-thirds {
    flex: 1;
}

.threecal-add-new {
    display: inline-block;
    margin-top: 8px;
    color: var(--cc-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.threecal-add-new:hover {
    color: var(--cc-primary-dark);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.threecal-admin .button-primary,
.threecal-submit-actions .button-primary {
    background: var(--cc-bg-gradient);
    border: none;
    color: #fff;
    padding: 10px 24px;
    border-radius: var(--cc-radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--cc-transition);
    box-shadow: var(--cc-shadow);
}

.threecal-admin .button-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--cc-shadow-lg);
}

.threecal-admin .button {
    border-radius: var(--cc-radius-sm);
    transition: var(--cc-transition);
}

.threecal-delete-link {
    color: var(--cc-danger);
    text-decoration: none;
    margin-left: 12px;
}

.threecal-delete-link:hover {
    color: #dc2626;
    text-decoration: underline;
}

.threecal-submit-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--cc-border);
    margin-top: 16px;
}

/* ==========================================================================
   Layout - Two Columns
   ========================================================================== */
.threecal-edit-container {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    margin-top: 24px;
}

.threecal-edit-main {
    background: var(--cc-card-bg);
    border-radius: var(--cc-radius-lg);
    padding: 24px;
    box-shadow: var(--cc-shadow);
    border: 1px solid var(--cc-border);
}

.threecal-two-columns {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 24px;
    margin-top: 24px;
}

.threecal-form-column .threecal-card {
    position: sticky;
    top: 40px;
}

/* ==========================================================================
   Categories List (Checkboxes)
   ========================================================================== */
.threecal-categories-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 4px;
}

.threecal-categories-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--cc-radius-sm);
    cursor: pointer;
    transition: var(--cc-transition);
    margin-bottom: 4px;
}

.threecal-categories-list label:hover {
    background: #f8fafc;
}

.threecal-cat-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* ==========================================================================
   Color Indicator
   ========================================================================== */
.threecal-color-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    margin-right: 8px;
    vertical-align: middle;
}

/* ==========================================================================
   Image Upload
   ========================================================================== */
.threecal-image-upload {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.threecal-image-preview {
    max-width: 200px;
    border-radius: var(--cc-radius-sm);
    overflow: hidden;
}

.threecal-image-preview img {
    display: block;
    width: 100%;
    height: auto;
}

/* ==========================================================================
   Status Labels
   ========================================================================== */
.threecal-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.threecal-status-draft {
    background: #fef3c7;
    color: #92400e;
}

.threecal-status-published {
    background: #d1fae5;
    color: #065f46;
}

.threecal-status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

/* ==========================================================================
   Category Tags
   ========================================================================== */
.threecal-category-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    margin-right: 4px;
}

/* ==========================================================================
   List Table Enhancements
   ========================================================================== */
.threecal-admin .wp-list-table {
    border-radius: var(--cc-radius);
    overflow: hidden;
    border: 1px solid var(--cc-border);
}

.threecal-admin .wp-list-table th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    font-weight: 600;
}

.threecal-admin .wp-list-table td {
    vertical-align: middle;
}

.threecal-time,
.threecal-all-day {
    color: var(--cc-text-light);
    font-size: 12px;
}

.threecal-actions-col {
    width: 140px;
}

/* ==========================================================================
   Stats Box
   ========================================================================== */
.threecal-stats {
    background: linear-gradient(135deg, var(--cc-primary) 0%, var(--cc-secondary) 100%);
    border-radius: var(--cc-radius-lg);
    padding: 24px;
    margin-top: 24px;
    color: #fff;
}

.threecal-stats h3 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
    opacity: 0.9;
}

.threecal-stats ul {
    display: flex;
    gap: 32px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.threecal-stats li {
    display: flex;
    flex-direction: column;
}

.threecal-stats li strong {
    font-size: 28px;
    font-weight: 700;
}

/* ==========================================================================
   Settings Page
   ========================================================================== */
.threecal-settings-page .nav-tab-wrapper {
    border-bottom: 2px solid var(--cc-border);
    margin-bottom: 24px;
}

.threecal-settings-page .nav-tab {
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    padding: 12px 20px;
    font-weight: 500;
    color: var(--cc-text-light);
    margin-bottom: -2px;
    transition: var(--cc-transition);
}

.threecal-settings-page .nav-tab:hover {
    color: var(--cc-primary);
    background: transparent;
}

.threecal-settings-page .nav-tab-active {
    color: var(--cc-primary);
    border-bottom-color: var(--cc-primary);
    background: transparent;
}

.threecal-settings-content {
    background: var(--cc-card-bg);
    border-radius: var(--cc-radius-lg);
    padding: 24px 32px;
    box-shadow: var(--cc-shadow);
    border: 1px solid var(--cc-border);
}

.threecal-settings-content .form-table th {
    padding: 20px 10px 20px 0;
    font-weight: 500;
}

.threecal-settings-content .form-table td {
    padding: 15px 10px;
}

.threecal-warning {
    color: var(--cc-danger);
    font-weight: 500;
}

.threecal-shortcode-reference {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--cc-border);
}

.threecal-shortcode-reference h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.threecal-shortcode-reference code {
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'SFMono-Regular', Consolas, monospace;
}

/* ==========================================================================
   Notices
   ========================================================================== */
.threecal-admin .notice {
    border-radius: var(--cc-radius-sm);
    border-left-width: 4px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1200px) {
    .threecal-edit-container {
        grid-template-columns: 1fr;
    }

    .threecal-two-columns {
        grid-template-columns: 1fr;
    }

    .threecal-form-column .threecal-card {
        position: static;
    }
}

@media (max-width: 782px) {
    .threecal-field-row {
        flex-direction: column;
    }

    .threecal-stats ul {
        flex-wrap: wrap;
    }
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.threecal-admin .threecal-card,
.threecal-admin .threecal-meta-box {
    animation: fadeIn 0.4s ease-out;
}

/* ==========================================================================
   Color Picker Enhancement
   ========================================================================== */
.threecal-color-picker {
    max-width: 100px;
}

.wp-picker-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wp-picker-container .wp-color-result {
    border-radius: var(--cc-radius-sm);
}

/* ==========================================================================
   Submit Row
   ========================================================================== */
.threecal-submit-row {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--cc-border);
}

/* ==========================================================================
   No Items Message
   ========================================================================== */
.threecal-no-items {
    text-align: center;
    padding: 40px;
    color: var(--cc-text-light);
    font-style: italic;
}

/* ==========================================================================
   New Header Design
   ========================================================================== */
.threecal-header {
    background: #fff;
    padding: 16px 24px;
    margin: -10px -20px 0 -20px;
    border-bottom: 1px solid #e1e5eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.threecal-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.threecal-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.threecal-logo-icon {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: #2563eb;
}

.threecal-admin-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    padding: 0;
    line-height: 1;
}

.threecal-version {
    font-size: 0.7rem;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
}


/* ==========================================================================
   Nav Tab Wrapper - Integrate With WordPress
   ========================================================================== */
.threecal-tabs.nav-tab-wrapper {
    background: #fff;
    margin: 0 -20px;
    padding: 0 24px;
    border-bottom: 1px solid #e1e5eb;
}

.threecal-tabs .nav-tab {
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    padding: 14px 18px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: -1px;
    transition: all 0.2s;
}

.threecal-tabs .nav-tab:hover {
    color: #2563eb;
    background: #f9fafb;
}

.threecal-tabs .nav-tab.nav-tab-active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background: transparent;
}


/* ==========================================================================
   Tab Content
   ========================================================================== */
.threecal-tab-content {
    padding: 24px 0;
}


/* ==========================================================================
   Support Tab
   ========================================================================== */
.threecal-support-card {
    text-align: center;
}

.threecal-intro {
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 24px;
}

.threecal-benefits-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.threecal-benefits-list li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.threecal-benefits-list .dashicons {
    color: #ef4444;
}

.threecal-support-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.threecal-support-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f9fafb;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    transition: all 0.2s;
}

.threecal-support-link:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.threecal-support-link .dashicons {
    color: #6b7280;
}

/* Help Page Styles */
.threecal-help-page .threecal-card {
    margin-bottom: 20px;
}

.threecal-code-block {
    display: block;
    background: #f6f7f7;
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 13px;
    overflow-x: auto;
}

.threecal-help-page h4 {
    margin: 20px 0 10px;
    color: #1d2327;
}

.threecal-help-page .feature-item {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
}

.threecal-help-page .feature-item .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    margin-bottom: 8px;
}

.threecal-help-page .feature-item strong {
    display: block;
    margin-bottom: 5px;
}

.threecal-help-page .feature-item p {
    margin: 0;
    color: #646970;
    font-size: 13px;
}
