/* ===================================
   TeamSync - macOS Style Design
   Base Styles & Common Components
   =================================== */

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

/* CSS Variables will be loaded from darkmode.css or lightmode.css */

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

/* ===================================
   macOS Window Style
   =================================== */

.app-window {
    display: flex;
    height: 100vh;
    background: var(--macos-bg);
    backdrop-filter: blur(80px);
}

/* ===================================
   Sidebar Navigation
   =================================== */

.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(60px) saturate(180%);
    -webkit-backdrop-filter: blur(60px) saturate(180%);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.sidebar-header {
    padding: 0 20px 30px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.app-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.sidebar-section {
    padding: 0 12px;
    margin-bottom: 24px;
}

.section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding: 0 12px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    font-weight: 500;
}

.nav-item i {
    font-size: 18px;
    width: 20px;
}

.nav-item-text {
    font-size: 13px;
}

.nav-badge {
    margin-left: auto;
    background: var(--accent-blue);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
}

/* ===================================
   Main Content Area
   =================================== */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===================================
   Toolbar
   =================================== */

.toolbar {
    background: var(--toolbar-bg);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-bottom: 1px solid var(--toolbar-border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toolbar-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.toolbar-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar-button {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.toolbar-button:hover {
    background: rgba(255, 255, 255, 0.12);
}

.toolbar-button.primary {
    background: var(--accent-blue);
    border-color: transparent;
}

.toolbar-button.primary:hover {
    background: #0051D5;
}

.icon-button {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* ===================================
   Content Area
   =================================== */

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    scroll-behavior: smooth;
    /* Safari flexbox fix */
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Custom Scrollbar */
.content-area::-webkit-scrollbar {
    width: 8px;
}

.content-area::-webkit-scrollbar-track {
    background: transparent;
}

.content-area::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.content-area::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===================================
   View Management
   =================================== */

.view {
    display: none;
}

.view {
    display: none;
    flex: 1;
    min-height: 0;
}

.view.active {
    display: flex !important;
    flex-direction: column !important;
    /* Safari flexbox fix - flex로 변경하여 높이 계산 문제 해결 */
    position: relative;
    width: 100%;
    /* 높이는 JavaScript로 동적 설정 */
}

/* ===================================
   Common Components
   =================================== */

/* Section */
.section {
    margin-bottom: 32px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

/* Glass Card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.card-tag {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-tag.urgent {
    background: rgba(255, 45, 85, 0.2);
    color: var(--accent-pink);
}

.card-tag.normal {
    background: rgba(0, 122, 255, 0.2);
    color: var(--accent-blue);
}

.card-tag.low {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.card-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Avatar */
.avatar-group {
    display: flex;
    align-items: center;
}

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--macos-bg);
    background-size: cover;
    background-position: center;
    margin-right: -8px;
}

.status-badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
    background: rgba(52, 199, 89, 0.2);
    color: var(--accent-green);
}

/* Team Member Card */
.team-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.team-card:hover {
    background: rgba(255, 255, 255, 0.12);
}

.team-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--macos-bg);
    position: absolute;
    bottom: 0;
    right: 0;
}

.status-dot.online {
    background: var(--accent-green);
}

.status-dot.away {
    background: var(--accent-orange);
}

.status-dot.offline {
    background: rgba(255, 255, 255, 0.3);
}

.team-info {
    flex: 1;
}

.team-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

.team-status {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===================================
   Animations
   =================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.6s ease-out;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

/* ===================================
   Settings Page Styles
   =================================== */

#view-settings {
    min-height: 100%;
}

.settings-container {
    max-width: 800px;
    width: 100%;
}

.settings-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.settings-card-header i {
    font-size: 24px;
    color: var(--accent-blue);
}

.settings-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-card-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.theme-option {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--card-border);
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

.theme-option:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent-blue);
}

.theme-option.active {
    background: rgba(0, 122, 255, 0.1);
    border-color: var(--accent-blue);
}

.theme-preview {
    width: 100%;
    height: 120px;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-preview-header {
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
}

.theme-preview-sidebar {
    position: absolute;
    left: 0;
    top: 20px;
    bottom: 0;
    width: 50px;
    background: rgba(255, 255, 255, 0.05);
}

.theme-preview-content {
    position: absolute;
    left: 50px;
    top: 20px;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.02);
    padding: 8px;
}

.theme-preview-content::before {
    content: '';
    display: block;
    width: 60%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    margin-bottom: 6px;
}

.theme-preview-content::after {
    content: '';
    display: block;
    width: 40%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.dark-preview {
    background: #1e1e1e;
}

.light-preview {
    background: #f5f5f7;
}

.light-preview .theme-preview-header {
    background: rgba(0, 0, 0, 0.05);
}

.light-preview .theme-preview-sidebar {
    background: rgba(0, 0, 0, 0.03);
}

.light-preview .theme-preview-content {
    background: rgba(0, 0, 0, 0.01);
}

.light-preview .theme-preview-content::before {
    background: rgba(0, 0, 0, 0.2);
}

.light-preview .theme-preview-content::after {
    background: rgba(0, 0, 0, 0.1);
}

.theme-option-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    margin-top: 8px;
}

.theme-option-label i {
    font-size: 18px;
    color: var(--text-primary);
}

.theme-radio {
    width: 20px;
    height: 20px;
    border: 2px solid var(--card-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 16px;
    right: 16px;
    transition: all 0.2s ease;
}

.theme-radio i {
    font-size: 12px;
    color: var(--accent-blue);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.theme-option.active .theme-radio {
    border-color: var(--accent-blue);
    background: var(--accent-blue);
}

.theme-option.active .theme-radio i {
    opacity: 1;
    color: white;
}