/* Vibrant Professional Dashboard for Tutoring Portal */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #417690;
  --primary-dark: #3d5a6a;
  --primary-vibrant: #5fa8d3;
  --primary-light: rgba(95, 168, 211, 0.1);
  --primary-deep: #4a7c92;
  --secondary: #e07a5f; /* Softened orange/coral */
  --accent: #d4a574;
  --bg-main: #f9f7f2;
  --white: #fffdfa;
  --text-main: #4a5568;
  --text-muted: #718096;
  --success: #38a169;
  --warning: #f6ad55;
  --card-shadow: 0 10px 25px rgba(31, 38, 135, 0.05);
  --card-hover-shadow: 0 20px 40px rgba(31, 38, 135, 0.1);
  --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  --border-radius: 20px;
}

/* Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 0% 0%, rgba(3, 164, 237, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(254, 63, 64, 0.05) 0%, transparent 40%);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
    flex: 1; /* Expand to fill space */
    width: 100%; /* Ensure full width */
}

h1, h2, h3, h4 {
  font-family: 'DM Serif Display', serif;
  font-weight: 400;
  color: var(--primary-dark);
}

/* Header & Navigation - Synced with Frontend */
header {
  background: var(--white);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border-bottom: 3px solid var(--primary-vibrant); /* Use variable instead of hardcoded hex */
}

.container {
  width: 95%; /* Increased from 90% */
  max-width: 1200px;
  margin: 0 auto;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0; /* Slightly reduced padding */
}

.logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.6rem; /* Slightly reduced from 1.8rem */
  color: var(--primary-vibrant);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap; /* Prevent logo text from wrapping */
}

.logo span {
  color: var(--secondary);
}

header .header-content a {
  text-decoration: none;
  color: inherit;
}

.user-info.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.user-info p {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  margin-right: 1rem;
}

.nav-link, .home-link {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem; /* Reduced from 0.95rem */
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px; /* Reduced from 8px */
  position: relative; /* Needed for absolute positioning of ::after */
}

.nav-link::after, .home-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--secondary);
  transition: var(--transition);
}

.nav-link:hover::after,
.home-link:hover::after,
.nav-link.active::after,
.home-link.active::after {
  width: 100%;
}

.nav-link:hover, .home-link:hover {
  color: var(--secondary);
}

.logout-link {
  color: var(--white) !important;
  background: var(--secondary);
  font-weight: 700;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  text-decoration: none;
}

.logout-link:hover {
  background: #e63535;
  box-shadow: 0 5px 15px rgba(254, 63, 64, 0.3);
}

/* Hamburger - Professional Styling */
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 10px;
  font-size: 1.4rem;
  color: var(--primary-vibrant);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.menu-toggle:hover {
  background: var(--primary-vibrant);
  color: var(--white);
}

@media (max-width: 992px) {
  .menu-toggle {
    display: flex;
  }

  .user-info.nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--white);
    flex-direction: column;
    padding: 2rem;
    gap: 1rem;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    border-top: 1px solid #eee;
    z-index: 1001;
  }

  .user-info.nav-links.active {
    display: flex;
  }

  .user-info p {
    margin-right: 0;
    margin-bottom: 1rem;
    color: var(--text-main);
    text-align: center;
    width: 100%;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
  }

  .nav-link, .home-link, .logout-link {
    width: 100%;
    justify-content: center;
  }
}

/* Dashboard Grid - Polished Spacing & Organization */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2rem;
  padding: 2rem 0 5rem;
  align-items: start;
}

.card {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  min-height: 100%; /* Ensure cards in the same row align height if needed */
}

/* Intelligent Column Spans for better balance */
.performance-graph {
  grid-column: span 8;
}

/* Performance Graph Container */
.performance-graph .card-content {
  height: 450px;
  overflow: hidden;
  padding: 1rem 0;
}

.performance-graph canvas {
  width: 100% !important;
  height: 100% !important;
}
.courses-overview { 
  grid-column: span 4; 
}

.tutor-remarks { 
  grid-column: span 8; 
}

.recent-scores { 
  grid-column: span 4; 
}

.upcoming-sessions { 
  grid-column: span 6; 
}

.recent-sessions { 
  grid-column: span 6; 
}

/* Content List Adjustments to prevent squishing */
.card-content {
  max-height: 380px;
  overflow-y: auto;
  margin-top: 0.5rem;
}

.course-item, .session-item, .score-item, .remark-item {
  padding: 1.2rem;
  background: #f3f4f6; /* Professional light grey */
  border-radius: 16px;
  border-left: 5px solid var(--primary);
  margin-bottom: 1rem;
  transition: var(--transition);
}

.score-item { border-left-color: var(--secondary); }
.session-item { border-left-color: var(--accent); }
.remark-item { border-left-color: #6b46c1; }

.session-item:hover {
  background: var(--white);
  transform: translateX(5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.btn-cancel-session {
    background: #fff5f5;
    color: #e53e3e;
    border: 1px solid #feb2b2;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 15px;
    white-space: nowrap;
}

.btn-cancel-session:hover {
    background: #e53e3e;
    color: white;
    border-color: #e53e3e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.2);
}

@media (max-width: 1280px) {
  .logo { font-size: 1.4rem; }
  .performance-graph { grid-column: span 12; }
  .courses-overview { grid-column: span 12; }
  .tutor-remarks { grid-column: span 12; }
  .recent-scores { grid-column: span 12; }
  .upcoming-sessions, .recent-sessions {
    grid-column: span 6;
  }
}

@media (max-width: 900px) {
  .performance-graph, .recent-scores, .upcoming-sessions, .recent-sessions, .tutor-remarks, .courses-overview {
    grid-column: span 12;
  }
}

/* Progress Bars - Colorful */
.progress-container {
  background: #e2e8f0;
  height: 10px;
  margin-top: 15px;
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #00d2ff 100%);
  box-shadow: 0 2px 10px rgba(3, 164, 237, 0.3);
  border-radius: 10px;
  transition: width 0.5s ease-out;
}

/* Graph Toggle Buttons */
.graph-toggle {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 12px;
    gap: 4px;
}

.toggle-btn {
    padding: 6px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.toggle-btn:hover {
    color: var(--primary);
}

.toggle-btn.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* Spinner */
.loading-container, .loading-spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem; /* More breathing room */
    width: 100%;
    min-height: 200px; /* Ensure it takes up space */
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #e2e8f0; /* Visible base ring */
    border-top: 6px solid var(--primary-vibrant); /* Vibrant spinning part */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Trial Expiration State */
body.trial-expired:not(.billing-page) main {
    display: none !important;
}

/* Disabled nav links when trial expires */
body.trial-expired .nav-links a:not([href*="billing"]):not(.logout-link) {
    color: var(--text-muted) !important;
    pointer-events: none !important;
    cursor: default !important;
}

body.trial-expired .home-link {
    pointer-events: none !important;
}

/* Subscription Canceled State - Selective Blocking */
body.subscription-canceled .nav-links a[href*="/courses/"],
body.subscription-canceled .nav-links a[href*="/book-tutoring/"] {
    color: var(--text-muted) !important;
    pointer-events: none !important;
    cursor: default !important;
    text-decoration: line-through; /* Visual cue */
    opacity: 0.6;
}
/* If on the actual restricted pages, hide main to avoid flashes behind overlay */
body.subscription-canceled.page-restricted main {
    display: none !important;
}

.plan-link {
    background: var(--primary);
    color: white !important;
    font-weight: 700;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    transition: var(--transition);
}

.plan-link:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(95, 168, 211, 0.3);
}

.btn-enroll.enrolled {
    background-color: var(--success) !important;
    color: white !important;
    opacity: 1 !important;
    cursor: default !important;
    box-shadow: none !important;
    border: none !important;
}

/* Reusable Modal & Overlay Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-content {
    background: white;
    padding: 40px;
    border-radius: 24px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    animation: modalFadeIn 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}
@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(20px); scale: 0.95; }
    to { opacity: 1; transform: translateY(0); scale: 1; }
}
.modal-icon {
    font-size: 4rem;
    margin-bottom: 25px;
}
.modal-title {
    font-family: 'DM Serif Display', serif;
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 15px;
}
.modal-text {
    color: var(--text-main);
    margin-bottom: 30px;
    line-height: 1.7;
    font-size: 1.05rem;
}
.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}
.modal-btn {
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
}
.modal-btn-primary {
    background: var(--primary);
    color: white;
}
.modal-btn-secondary {
    background: #edf2f7;
    color: #4a5568;
}
.modal-btn-danger {
    background: #e53e3e;
    color: white;
}
.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

/* Footer Styles */
.site-footer {
    background-color: var(--primary-dark);
    color: var(--white);
    padding: 4rem 0 2rem;
    margin-top: auto; /* Push to bottom in flex container */
    width: 100%;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.footer-brand .logo {
    font-family: 'DM Serif Display', serif;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--white);
}

.footer-brand .logo img {
    height: 35px;
    margin-right: 10px;
}

.footer-brand .logo span {
    color: var(--secondary);
}

.footer-brand .tagline {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 300px;
}

.footer-links h4 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--white);
}

.footer-links ul {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--secondary);
    padding-left: 5px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    margin: 0;
}

.footer-legal a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-legal a:hover {
    color: var(--white);
}

/* Gamification Styles */
.gamification-stats {
    display: flex;
    align-items: center;
    gap: 12px; /* Reduced from 20px */
    margin-right: 15px; /* Reduced from 25px */
    padding-right: 15px; /* Reduced from 25px */
    border-right: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px; /* Reduced from 8px */
    font-weight: 700;
    font-size: 0.85rem; /* Slightly smaller font */
}

.stat-item.streak { 
    color: #e07a5f; 
    padding-left: 1em;
} /* Orange flame */
.stat-item.streak i {
    animation: flamePulse 1.5s infinite ease-in-out;
}

@keyframes flamePulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; filter: drop-shadow(0 0 5px #e07a5f); }
}

.stat-item.level { color: #d4a574; } /* Gold star */

.xp-container {
    width: 80px; /* Reduced from 120px */
    height: 8px; /* Slightly thinner */
    background: #edf2f7;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #5fa8d3 0%, #3d5a6a 100%);
    width: 0%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ensure nav links stay on one line */
.user-info.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem; /* Reduced from 1.5rem */
    white-space: nowrap;
    flex-wrap: nowrap;
}

.user-info p {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-right: 0.5rem; /* Reduced from 1rem */
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Update mobile layout for stats */
@media (max-width: 1024px) {
    .gamification-stats {
        margin-right: 0;
        padding-right: 0;
        border-right: none;
        margin-bottom: 15px;
        width: 100%;
        justify-content: center;
    }
}

/* Study Planner Styles */
.study-planner.full-width {
    grid-column: 1 / -1;
}

#planner-loader p {
    margin-top: 0 !important;
    margin-left: 1.5rem !important;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    color: #718096;
    font-weight: 500;
}

/* Custom Premium Select */
.custom-select-container {
    position: relative;
    width: auto;
    min-width: 200px;
    user-select: none;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    height: 40px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-dark);
    gap: 15px; /* Added breathing room */
}

.custom-select-trigger span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-select-container:hover .custom-select-trigger {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(95, 168, 211, 0.1);
}

.custom-select-container.active .custom-select-trigger {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(95, 168, 211, 0.2);
}

.custom-select-trigger i {
    font-size: 0.8rem;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.custom-select-container.active .custom-select-trigger i {
    transform: rotate(180deg);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    border: 1px solid #edf2f7;
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    padding: 8px;
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.custom-select-container.active .custom-select-options {
    display: flex;
}

.custom-option {
    padding: 10px 15px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.custom-option:hover {
    background: #f0f9ff;
    color: var(--primary);
}

.custom-option.selected {
    background: var(--primary);
    color: white;
}

.planner-placeholder {
    text-align: center;
    padding: 2rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
}

.planner-placeholder p {
    color: #64748b;
    margin-bottom: 1.5rem;
}

.btn-setup-planner {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-setup-planner:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(95, 168, 211, 0.3);
}

.daily-path {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding: 20px 5px 30px;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    user-select: none;
    position: relative;
}

.daily-path.grabbing {
    cursor: grabbing;
}

/* Timeline line behind cards */
.daily-path::before {
    content: '';
    position: absolute;
    top: 110px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e2e8f0;
    z-index: 0;
}

.path-day {
    flex: 0 0 300px;
    background: white;
    border: 1px solid #edf2f7;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.03);
    position: relative;
    z-index: 1;
    transition: var(--transition);
}

.path-day:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.06);
}

.path-day.today {
    border: 2px solid var(--primary);
    background: linear-gradient(to bottom, #f0f9ff, white);
    box-shadow: 0 10px 30px rgba(95, 168, 211, 0.15);
}

.path-day.today::after {
    content: 'CURRENT FOCUS';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 1px;
}

.day-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 15px;
    display: block;
    opacity: 0.6;
}

.path-day.today .day-label {
    color: var(--primary);
    opacity: 1;
}

/* Task styling inside cards */
.day-tasks {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    color: #4a5568;
    background: #f8fafc;
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: var(--transition);
}

.task-item:hover {
    background: white;
    border-color: #e2e8f0;
}

.task-item.completed {
    background: #f0fff4;
    color: #718096;
}

.task-item i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Hide scrollbar for a cleaner look, use drag instead */
.daily-path::-webkit-scrollbar {
    display: none;
}
.daily-path {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.task-item.lesson i { color: #5fa8d3; }
.task-item.quiz i { color: #e07a5f; }
.task-item.review i { color: #d4a574; }

/* Planner Form Enhancements */
.planner-form {
    text-align: left;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

.nice-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 2px solid #edf2f7;
    background: #f8fafc;
    font-family: inherit;
    font-size: 1rem;
    color: #2d3748;
    transition: var(--transition);
    appearance: none;
}

.nice-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(95, 168, 211, 0.1);
}

.date-input-wrapper {
    position: relative;
}

.calendar-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    pointer-events: none;
}

/* Make standard date picker look better */
.date-picker::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
}

