/* dashboard_styles.css */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #007AFF; /* Apple blue - vibrant and clean */
    --primary-hover: #0056b3;
    --secondary-color: #6c757d;
    --secondary-hover: #5a6268;
    --text-color: #333;
    --text-light: #555;
    --background-light: #f8f9fa; /* Very light gray */
    --background-white: #ffffff;
    --border-color: #dee2e6;
    --border-radius: 8px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.08);
    --green: #34c759; /* Apple green */
    --orange: #ff9500; /* Apple orange */
}

/* --- General Reset & Body --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%; /* Ensure body takes full height */
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-light);
    color: var(--text-color);
    display: flex; /* Use flex for dashboard structure */
    flex-direction: column;
    line-height: 1.6;
}

/* --- Dashboard Layout --- */
.dashboard {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Ensure it covers viewport */
}

/* --- Header --- */
.header {
    background-color: var(--background-white);
    padding: 1rem 2rem; /* Consistent padding */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0; /* Prevent header from shrinking */
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.5px; /* Slightly tighter spacing */
}

.nav {
    display: flex;
    gap: 0.75rem;
}

/* --- General Button Styles --- */
button {
    cursor: pointer;
    font-family: inherit; /* Inherit font */
    transition: all 0.2s ease-in-out;
}

/* Navigation Buttons */
.nav-item {
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    text-decoration: none; /* In case it's an anchor later */
}

.button-primary {
    background-color: var(--primary-color);
    color: var(--background-white);
}
.button-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.button-secondary {
    background-color: var(--background-white);
    color: var(--primary-color);
    border-color: var(--border-color);
}
.button-secondary:hover {
    border-color: var(--primary-color);
    background-color: #eef6ff; /* Very light blue tint */
}


/* --- Main Content --- */
.main-content {
    flex-grow: 1; /* Allow main content to take available space */
    padding: 2.5rem 2rem; /* More padding */
    width: 100%;
    max-width: 1200px; /* Limit max width for larger screens */
    margin: 0 auto; /* Center content */
}

.intro-text {
    text-align: center;
    margin-bottom: 3rem;
}
.intro-text h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}
.intro-text p {
    font-size: 1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto; /* Center paragraph */
}

/* --- Tool Cards Grid --- */
.tool-cards {
    display: grid;
    /* Fewer columns, more space */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem; /* Generous gap */
}

/* --- Individual Tool Card --- */
.tool-card {
    background-color: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative; /* For badges */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden; /* Hide badge overflow if needed */
}
.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

/* Card Badges Container */
.card-badges {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    flex-direction: column; /* Stack badges vertically */
    gap: 0.4rem;
    align-items: flex-start; /* Align badges left */
}

.badge { /* Base badge style */
  color: white;
  padding: 0.3em 0.7em;
  font-size: 0.75em;
  font-weight: 600; /* Bolder badge text */
  border-radius: 5px; /* Slightly less round */
  text-transform: uppercase; /* Uppercase text */
  letter-spacing: 0.5px;
  display: inline-block; /* Needed for padding */
}

.badge.free {
  background-color: var(--green);
}

.badge.time-limit {
  background-color: #DC3545; /* Changed from var(--orange) to red */
  color: white; /* Or var(--background-white) */
  font-size: 0.7em;
  display: flex;
  align-items: center;
  gap: 0.3em;
}

/* Card Icon */
.card-icon {
    width: 60px; /* Fixed icon size */
    height: 60px;
    margin-bottom: 1.5rem; /* More space below icon */
    object-fit: contain; /* Ensure icon isn't distorted */
}

/* Card Title */
.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

/* Card Description */
.card-description {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1.5rem; /* Space before button */
    min-height: 2.8em; /* Reserve space for 2 lines */
}

/* Card Launch Button */
.button-launch {
    margin-top: auto; /* Push button to bottom */
    padding: 0.7rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    background-color: var(--primary-color);
    color: var(--background-white);
    width: 80%; /* Make button wider */
}
.button-launch:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}


/* --- Footer --- */
.footer {
    background-color: var(--background-white);
    color: var(--secondary-color);
    text-align: center;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    margin-top: auto; /* Push footer to bottom if content is short */
    flex-shrink: 0; /* Prevent footer from shrinking */
}

/* --- Toast Message (Structure only) --- */
/* Add styles if/when needed */


/* --- Matilda Elements --- */
/* Basic positioning and appearance - kept similar */
.matilda-icon {
  position: fixed;
  bottom: 25px; /* Slightly adjusted */
  right: 25px;
  z-index: 990;
}
.matilda-icon img {
  width: 60px; height: auto; border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border: 3px solid var(--background-white); /* White border */
}

#matilda-note {
  position: fixed;
  bottom: 100px; /* Adjusted */
  right: 30px;
  /* Changed to light theme */
  background-color: var(--primary-color);
  color: white;
  padding: 0.75em 1.2em;
  border-radius: var(--border-radius);
  font-size: 0.9em;
  font-weight: 500;
  z-index: 991;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  animation: obvious-glow 1.5s infinite ease-in-out; /* Kept glow */
}
#matilda-note::after { /* Speech bubble pointer */
  content: ""; position: absolute;
  bottom: -9px; right: 15px; width: 0; height: 0;
  border-left: 10px solid transparent; border-right: 10px solid transparent;
  /* Pointer matches bubble background */
  border-top: 10px solid var(--primary-color);
}
/* Obvious Glow animation remains the same */
@keyframes obvious-glow {
  0%, 100% { box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15), 0 0 8px rgba(0, 122, 255, 0.4); }
  50% { box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2), 0 0 25px rgba(0, 122, 255, 0.7), 0 0 15px rgba(100, 180, 255, 0.5); }
}


/* --- Matilda Interaction Modal (Light Theme) --- */
.matilda-modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.6); /* Slightly less dark overlay */
  z-index: 1010; display: flex; align-items: center; justify-content: center;
  padding: 1em; opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
.matilda-modal-overlay.visible {
  opacity: 1; visibility: visible; transition: opacity 0.3s ease;
}

.matilda-modal-content {
  /* Changed to light theme */
  background-color: var(--background-white);
  color: var(--text-color);
  padding: 2rem; /* More padding */
  border-radius: 12px; /* More rounded */
  max-width: 500px; /* Slightly narrower */
  width: 100%;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  position: relative;
  transform: scale(0.95);
  transition: transform 0.3s ease;
  text-align: center;
}
.matilda-modal-overlay.visible .matilda-modal-content { transform: scale(1); }

#modal-initial-view p { line-height: 1.6; }
#modal-initial-view .modal-buttons { margin-top: 2.5em; } /* More space */

#modal-message-view { padding-top: 3.5em; } /* Space for controls */

.modal-controls-top-right {
  position: absolute; top: 1rem; right: 1rem;
  display: flex; gap: 0.75em; z-index: 1011;
}

/* Modal Button Base Style (Inside Modal) */
.modal-button {
  padding: 0.6em 1.2em; border: none; border-radius: 6px;
  cursor: pointer; font-size: 0.9em; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.6em; transition: all 0.2s ease;
  color: white; /* Default text color */
}
.modal-button:active { transform: scale(0.97); }
.modal-button i { font-size: 0.9em; line-height: 1; }

/* Modal Control Buttons (Top Right) */
.modal-controls-top-right .modal-button {
  background-color: var(--background-light); /* Light background */
  color: var(--secondary-color); /* Gray text */
  border: 1px solid var(--border-color);
}
.modal-controls-top-right .modal-button:hover {
  background-color: var(--border-color);
  color: var(--text-color);
}
/* Specific control button styles (optional - could be more subtle) */
.modal-controls-top-right .modal-button.close:hover { background-color: #ffebee; color: #c62828; } /* Light red tint */
.modal-controls-top-right .modal-button.audio-toggle:hover { background-color: #e3f2fd; color: #1565c0; } /* Light blue tint */


/* Modal Action Buttons (Play/Read) */
.modal-button.play { background-color: var(--green); }
.modal-button.play:hover { background-color: #28a745; } /* Darker green */
.modal-button.read { background-color: var(--primary-color); }
.modal-button.read:hover { background-color: var(--primary-hover); }

/* Modal Message Text */
#modal-message-text {
  text-align: left; line-height: 1.7;
  max-height: 60vh; overflow-y: auto; padding-right: 0.5em;
  color: var(--text-light); /* Slightly lighter text for message */
}
#modal-message-text p { margin-bottom: 1em; }
#modal-message-text p:last-child { margin-bottom: 0; }
#modal-message-text .emoji-bullet { color: var(--green); margin-right: 0.5em; display: inline-block; }
#modal-message-text em { font-style: normal; color: var(--primary-color); font-weight: 600; } /* Bolder emphasis */
#modal-message-text strong { color: var(--orange); font-weight: 700; } /* Even bolder */

/* Modal Don't Show Checkbox */
.modal-dont-show { text-align: center; margin-top: 2.5em; font-size: 0.85em; opacity: 0.9; color: var(--text-light); }
.modal-dont-show label { cursor: pointer; margin-left: 0.5em; }
.modal-dont-show input[type="checkbox"] { cursor: pointer; vertical-align: middle; margin-right: 0.2em; }

/* Utility class */
.hidden { display: none !important; }


/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
    .main-content { padding: 2rem 1.5rem; }
    .tool-cards { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
}

@media (max-width: 768px) {
    .header { padding: 1rem 1.5rem; }
    .logo { font-size: 1.5rem; }
    .nav-item { padding: 0.5rem 1rem; font-size: 0.85rem; }
    .main-content { padding: 1.5rem 1rem; }
    .intro-text h2 { font-size: 1.6rem; }
    .intro-text p { font-size: 0.95rem; }
    .tool-cards { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } /* Allow slightly smaller cards */
}

@media (max-width: 576px) {
    .header { flex-direction: column; gap: 0.75rem; padding-bottom: 0.75rem; }
    .nav { width: 100%; justify-content: center; } /* Center nav buttons */
    .tool-cards { grid-template-columns: 1fr; } /* Single column */
    .main-content { padding: 1.5rem 1rem; }
    .footer { padding: 1rem; font-size: 0.8rem; }

    /* Matilda adjustments */
    .matilda-icon { bottom: 15px; right: 15px; }
    .matilda-icon img { width: 50px; border-width: 2px; }
    #matilda-note { bottom: 75px; right: 20px; font-size: 0.85em; padding: 0.6em 1em; }
    #matilda-note::after { right: 10px; bottom: -8px; border-top-width: 8px; }

    /* Modal adjustments */
    .matilda-modal-content { padding: 1.5rem 1rem; }
    .modal-buttons { flex-direction: column; gap: 0.75rem; } /* Stack buttons */
}