/* style.css — Professional Dashboard Theme */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

:root {
  /* Colours */
  /* --bg-page:             #eef2f7; */
  --bg-page: transparent;
  --header-bg:           rgba(49, 130, 206, 0.85);
  --header-text:         #ffffff;
  --card-bg:             #ffffff;
  --card-radius:         12px;
  --card-shadow:         0 1px 3px rgba(0,0,0,0.1);
  --card-shadow-strong:  0 4px 8px rgba(0,0,0,0.15);
  --text-primary:        #2d3748;
  --text-secondary:      #4a5568;
  --accent:              #3182ce;
  --accent-hover:        #2b6cb0;
  --border-light:        #cbd5e0;
  --spacing-sm:          0.5rem;
  --spacing-md:          1rem;
  --spacing-lg:          1.5rem;
  --font-base:           'Poppins', sans-serif;

  /* Navbar fixed height */
  --header-fixed-height: 64px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  background-image: url(https://zyonz.ae/uploads/blog/thumb/smart%20home%20living.webp);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow-x: hidden;
  overflow-y: auto;
  font-family: var(--font-base);
  color: var(--text-primary);
  line-height: 1.5;
}

/* Make the dashboard container fill the viewport and use flex internally */
comp2110-dashboard {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
comp2110-dashboard > header {
  background: var(--header-bg);
  color: var(--header-text);
  height: 100px;
  padding: 0 var(--spacing-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--card-shadow-strong);
  position: sticky;
  top: 0;
  z-index: 100;
}

comp2110-dashboard > header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: var(--header-fixed-height);
}

comp2110-dashboard > header login-widget,
comp2110-dashboard > header login-widget form {
  line-height: var(--header-fixed-height);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--spacing-sm);
}

/* Ad hero */
.ad-hero {
  display: flex;
  justify-content: center;
  padding: var(--spacing-lg) 0;
  background: transparent;
  box-shadow: none;
}

.ad-hero ad-widget {
  background: transparent !important;
  border: none             !important;
  box-shadow: none         !important;
  margin: 0;
}

/* Main content */
comp2110-dashboard > main {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-lg);
  padding: var(--spacing-lg);
}

/* Force widgets to fill their columns */
comp2110-dashboard > main > * {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}

/* Widget cards */
todo-list-widget,
device-control-widget,
.placeholder-card {
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: var(--spacing-md);
  border: 1px solid var(--border-light);
  transition: box-shadow 0.2s ease,
              transform    0.2s ease;
}

todo-list-widget:hover,
device-control-widget:hover,
.placeholder-card:hover {
  box-shadow: var(--card-shadow-strong);
  transform: translateY(-4px);
}

/* Form elements */
input,
textarea,
select,
button {
  font-family: inherit;
  font-size: 1rem;
  border-radius: var(--card-radius);
  border: 1px solid var(--border-light);
  padding: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
  width: 100%;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.2);
}

/* Buttons */
button {
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 600;
  padding: var(--spacing-sm);
  transition: background 0.2s ease,
              transform  0.2s ease;
}

button:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Footer */
comp2110-dashboard > footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border-light);
  padding: var(--spacing-md) var(--spacing-lg);
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Mobile navbar fix: up to 600px */
@media (max-width: 600px) {
  comp2110-dashboard > header {
    flex-direction: column;
    align-items: flex-start;
    height: auto !important;
    padding: 0.25rem;
    align-items: center;
  }

  comp2110-dashboard > header h1 {
    font-size: 1.2rem;
    margin-top: 0.2rem;
    margin-bottom: 0.2rem;
    line-height: 1.2;
  }

  comp2110-dashboard > header login-widget,
  comp2110-dashboard > header login-widget form {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.2rem;
    line-height: normal;
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
  }

  comp2110-dashboard > header login-widget label {
    font-size: 0.75rem;
    margin-bottom: 0;
  }

  comp2110-dashboard > header login-widget input {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    height: auto;
  }

  comp2110-dashboard > header login-widget input[type="submit"] {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    align-self: flex-start;
  }
}

/* Tablet / small desktop: single-column layout up to 900px */
@media (max-width: 900px) {
  .widgets-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
  }

  .widgets-container > * {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  comp2110-dashboard > main {
    display: flex;
    flex-direction: column;
    padding: var(--spacing-md);
    overflow-y: auto;
  }
}

html, body {
  overflow-y: auto !important;  /* browser scrollbar back on */
  height: auto     !important;
}

/* Kill the “scroll self” on the dashboard main */
comp2110-dashboard > main {
  flex: none          !important;
  overflow-y: visible !important;
  height: auto        !important;
}

