:root {
    /* Brand Colors */
    --ph-orange: #ff6154;
    --ph-orange-hover: #e04437;
    --ph-dark: #212429;
    --ph-gray: #4b587c;
    
    /* Light Theme (Default) */
    --bg-main: #f5f8fa;
    --bg-card: #ffffff;
    --text-main: #212429;
    --text-muted: #4b587c;
    --border: #e0e6ed;
    --border-hover: #cacedb;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --input-bg: #f9fbfc;
    
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

[data-theme="dark"] {
    /* Dark Theme */
    --bg-main: #0B0E14;
    --bg-card: #141820;
    --text-main: #f5f8fa;
    --text-muted: #8b96a5;
    --border: #2a313e;
    --border-hover: #3d4658;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --glass-bg: rgba(20, 24, 32, 0.8);
    --input-bg: #0f1218;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Base Typography */
h1 { font-size: 24px; font-weight: 700; color: var(--text-main); }
h2 { font-size: 18px; font-weight: 600; color: var(--text-main); margin-bottom: 16px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

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

.btn-primary:hover {
    background-color: var(--ph-orange-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 97, 84, 0.3);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--ph-orange);
    color: var(--ph-orange);
}

.w-full { width: 100%; }
.flex-1 { flex: 1; }

/* Inputs */
input[type="text"], .select-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: var(--input-bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s ease;
}

input[type="text"]:focus, .select-input:focus {
    outline: none;
    border-color: var(--ph-orange);
    box-shadow: 0 0 0 3px rgba(255, 97, 84, 0.1);
}

/* App Layout */
.app-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    background-color: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-box {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--ph-orange);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background-color: var(--border);
    color: var(--text-main);
}

.countdown-panel {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.countdown-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.countdown-timer {
    font-size: 24px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--ph-orange);
    text-shadow: 0 2px 10px rgba(255, 97, 84, 0.2);
}

.main-content {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 24px;
}

/* Grid Layout */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    align-items: start;
}

.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-3 { grid-column: span 3; }

@media (max-width: 1024px) {
    .span-4, .span-5, .span-3 { grid-column: span 12; }
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 {
    margin: 0;
}

.card-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Checklist */
.checklist-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background-color: var(--bg-main);
    transition: all 0.2s ease;
    cursor: pointer;
}

.checklist-item:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.checklist-item.checked {
    opacity: 0.6;
    background-color: transparent;
    border-style: dashed;
}

.checklist-item.checked .item-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid var(--border-hover);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s ease;
    margin-top: 2px;
}

.checklist-item.checked .checkbox-custom {
    background-color: var(--ph-orange);
    border-color: var(--ph-orange);
}

.item-content {
    flex: 1;
}

.item-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.item-desc {
    font-size: 13px;
    color: var(--text-muted);
}

.progress-badge {
    background-color: rgba(255, 97, 84, 0.1);
    color: var(--ph-orange);
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 12px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px; /* Prevent scrollbar cutoff */
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 16px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.tab:hover {
    background-color: var(--bg-main);
    color: var(--text-main);
}

.tab.active {
    background-color: var(--ph-orange);
    color: white;
}

.tab-content {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.tab-content.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.context-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.result-box {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: var(--input-bg);
    overflow: hidden;
}

.result-box .label {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 8px 16px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.output-text {
    padding: 44px 16px 16px;
    min-height: 120px;
    font-size: 14px;
    line-height: 1.6;
    outline: none;
    white-space: pre-wrap;
}

.copy-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    opacity: 0.5;
}

.result-box:hover .copy-btn {
    opacity: 1;
}

/* Visuals */
.badge-preview {
    display: flex;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle, var(--border) 1px, transparent 1px);
    background-size: 16px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.controls input[type="color"] {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.canvas-wrapper {
    width: 100%;
    aspect-ratio: 1200/630;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    background: radial-gradient(circle, var(--border) 1px, transparent 1px);
    background-size: 16px 16px;
}

canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: var(--text-main);
    color: var(--bg-main);
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
