/* style.css - Refined Jony Ive Style */
:root {
    --primary-color: #1d1d1f; /* Apple Deep Black/Gray */
    --accent-color: #0071e3; /* Classic Apple Blue */
    --success-color: #34c759;
    --warning-color: #ff3b30;
    --bg-color: #f5f5f7; /* Apple Off-white */
    --card-bg: rgba(255, 255, 255, 0.7);
    --text-color: #1d1d1f;
    --text-secondary: #86868b;
    --border-color: rgba(0, 0, 0, 0.05);
    --shadow-soft: 0 8px 30px rgba(0,0,0,0.04);
    --shadow-hover: 0 12px 40px rgba(0,0,0,0.08);
    --radius-lg: 20px;
    --radius-md: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
}

#appContainer {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.sidebar {
    width: 320px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: #fff;
    border-right: 1px solid #f0f0f5;
    display: flex;
    flex-direction: column;
    padding: 3rem 1.5rem;
    z-index: 100;
    align-items: center;
}

.logo-section {
    margin-bottom: 2rem;
    text-align: center;
    width: 100%;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 2px;
    margin-top: 15px;
    text-transform: uppercase;
}

.by-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 8px 0 2px;
}

.owner-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #000;
}

.nav-links {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.2rem;
    width: 100%;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    background: #fff;
    border: 1px solid rgba(0, 113, 227, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-size: 0.95rem;
}

.nav-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.nav-item.active {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    box-shadow: 0 8px 20px rgba(0, 113, 227, 0.25);
}

.user-profile {
    margin-top: auto;
    padding-top: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.avatar {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a5d8ff 0%, #74c0fc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #fff;
    font-size: 1.5rem;
    box-shadow: 0 8px 16px rgba(116, 192, 252, 0.4);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.user-name {
    font-weight: 500;
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.user-actions {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.user-actions a, .user-actions span {
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
}

.user-actions a:hover {
    text-decoration: underline;
}

.content-wrapper {
    flex: 1;
    margin-left: 320px;
    padding: 3rem 4rem;
    max-width: calc(100% - 320px);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    padding: 1.2rem 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative; /* For absolute calendar placement */
}

.date-display {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    padding: 0.6rem 2.5rem;
    background: #fff;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-display::after {
    content: '▼';
    font-size: 0.7rem;
    opacity: 0.3;
}

.date-display:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

/* Custom Calendar Modal */
.calendar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.2); /* Slightly darker */
    backdrop-filter: blur(15px); /* More blur */
    z-index: 9999; /* Max priority */
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.calendar-modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(40px) saturate(180%);
    border-radius: 40px;
    padding: 40px;
    box-shadow: 0 40px 80px rgba(0,0,0,0.25);
    border: 1px solid rgba(255, 255, 255, 0.6);
    width: 600px; /* 50% larger than 400px */
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    max-width: 95vw;
    max-height: 95vh;
    animation: modalAppear 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes modalAppear {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

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

.calendar-header span {
    font-weight: 700;
    font-size: 1.8rem; /* Scaled up */
    color: var(--text-color);
    letter-spacing: -1px;
}

.calendar-btn {
    background: rgba(0, 113, 227, 0.08);
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--accent-color);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.calendar-btn:hover {
    background: var(--accent-color);
    color: #fff;
    transform: scale(1.1);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 15px; /* Increased gap */
    text-align: center;
    flex: 1; /* Fills remaining space in the square */
    align-content: center;
}

.weekday {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    font-size: 1.4rem; /* Scaled up numbers */
    transition: all 0.2s;
    font-weight: 500;
}

.day:hover:not(.empty) {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

.day.selected {
    background: var(--accent-color);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 8px 16px rgba(0, 113, 227, 0.3);
}

.day.today {
    color: var(--accent-color);
    box-shadow: inset 0 0 0 2px rgba(0, 113, 227, 0.2);
}

.day.empty {
    cursor: default;
}

.board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(550px, 1fr));
    gap: 2rem;
    padding-bottom: 5rem;
    width: 100%;
}

.tech-card {
    background: var(--card-bg);
    backdrop-filter: blur(25px);
    border-radius: var(--radius-lg);
    padding: 0;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.4);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tech-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    background: rgba(255, 255, 255, 0.85);
    padding-bottom: 5px; /* Minimal space at bottom as requested */
}

.tech-header {
    background: transparent;
    color: var(--accent-color); /* Apple Blue */
    padding: 1.2rem 1rem 0.8rem;
    text-align: center;
    font-weight: 700;
    font-size: 1.33rem;
    letter-spacing: -0.5px;
    text-transform: none;
    border-bottom: 1px solid var(--border-color);
    text-shadow: 0 1px 2px rgba(0, 113, 227, 0.1); /* Subtle Apple-style shadow */
}

.notes-card-header {
    color: #b8860b !important; /* Dark Goldenrod / Mustard Yellow */
    text-shadow: 0 1px 2px rgba(184, 134, 11, 0.1);
}

.tasks-list {
    min-height: 140px; /* Reduced to fit 5 compact rows and save space */
    padding: 0;
    display: flex;
    flex-direction: column;
    border-top: 1px solid #d1d1d6;
}

.task-item {
    padding: 2px 10px;
    border-bottom: 1px solid #d1d1d6; /* Darker, more visible gray */
    font-size: 0.75rem; /* ~20% smaller than 0.9rem */
    color: var(--text-color);
    transition: all 0.2s ease;
    outline: none;
    min-height: 28px; /* Minimum height for compact look */
    display: flex;
    align-items: center;
    background: #fff;
    position: relative;
}

/* Color tags */
.task-item.color-red { color: #ff3b30 !important; font-weight: 600; }
.task-item.color-green { color: #34c759 !important; font-weight: 600; }
.task-item.color-blue { color: #0071e3 !important; font-weight: 600; }
.task-item.color-orange { color: #ff9500 !important; font-weight: 600; }

.task-item.color-red .color-dot { background: #ff3b30; opacity: 1; }
.task-item.color-green .color-dot { background: #34c759; opacity: 1; }
.task-item.color-blue .color-dot { background: #0071e3; opacity: 1; }
.task-item.color-orange .color-dot { background: #ff9500; opacity: 1; }
.task-item.color-default .color-dot { background: #d1d1d6; }

.color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 12px;
    opacity: 0.4;
    cursor: pointer;
    flex-shrink: 0;
    background: #d1d1d6; /* Default gray for dot */
    transition: all 0.2s;
}

.task-item:hover .color-dot, .task-item:focus-within .color-dot {
    opacity: 1;
    transform: scale(1.2);
}

.task-item:last-child {
    border-bottom: none;
}

.task-text {
    flex: 1;
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

.task-item:hover, .task-item:focus-within {
    background: rgba(0, 113, 227, 0.03);
}

.task-item.heading {
    color: #ff3b30;
    font-weight: 600;
    text-align: center;
    background: rgba(255, 59, 48, 0.05);
    margin: 8px 0;
}

.notes-content {
    padding: 0 10px;
    min-height: 140px; /* Matches 5 rows of 28px */
    font-size: 0.75rem; /* Same as task items */
    line-height: 28px; /* Aligns text to 28px rows */
    color: var(--text-color);
    outline: none !important;
    border-top: none;
    background-image: repeating-linear-gradient(
        transparent, 
        transparent 27px, 
        #d1d1d6 27px, 
        #d1d1d6 28px
    );
    background-size: 100% 28px;
}

.controls {
    position: fixed;
    bottom: 3rem;
    right: 3rem;
    display: flex;
    gap: 15px;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 50px;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.btn-primary:hover {
    background: #000;
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

/* Login Screen */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.login-card {
    background: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hover);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    margin-bottom: 2rem;
}

.login-form input {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: #fbfbfd;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.login-form input:focus {
    border-color: var(--accent-color);
}

.login-btn {
    width: 100%;
    margin-top: 1rem;
}

.login-error {
    color: var(--warning-color);
    margin-top: 1rem;
    font-size: 0.9rem;
    display: none;
}

.hidden {
    display: none !important;
}

/* Print Styles */
@media print {
    body { background: white; padding: 0; display: block; }
    .sidebar, .controls, header, .date-display { display: none !important; }
    .content-wrapper { margin-left: 0; padding: 0; }
    .board { display: block; }
    .tech-card { 
        box-shadow: none; 
        border: 1px solid #ccc; 
        margin-bottom: 2rem; 
        break-inside: avoid;
        border-radius: 0;
    }
    .tech-header { font-size: 1.2rem; border-bottom: 2px solid #000; }
    .task-item { border-bottom: 1px solid #eee; }
    .print-header { display: block !important; text-align: center; margin-bottom: 3rem; }
}

.print-header { display: none; }
