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

:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  --danger-gradient: linear-gradient(135deg, #fc466b 0%, #3f5efb 100%);
  --warning-gradient: linear-gradient(135deg, #fdbb2d 0%, #22c1c3 100%);

  --text-primary: #2d3748;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --border-color: #e2e8f0;
  --bg-light: #f7fafc;
  --bg-white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);

  --border-radius: 12px;
  --border-radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--primary-gradient);
  min-height: 100vh;
  padding: 20px;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--bg-white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

/* Header Styles */
header {
  background: var(--secondary-gradient);
  color: white;
  padding: 40px 30px;
  position: relative;
  overflow: hidden;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  z-index: 2;
}

.header-icon {
  font-size: 3rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.header-text h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-text p {
  font-size: 1.1rem;
  opacity: 0.9;
  font-weight: 400;
}

.header-decoration {
  position: absolute;
  top: -50%;
  right: -10%;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.2;
  }
}

/* Form Styles */
.form-section {
  padding: 40px 30px;
}

.form-card {
  background: var(--bg-white);
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

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

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.date-inputs {
  display: flex;
  gap: 12px;
}

select,
input[type="text"],
input[type="number"] {
  padding: 14px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 16px;
  font-weight: 500;
  transition: var(--transition);
  background: var(--bg-white);
  color: var(--text-primary);
}

select:focus,
input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  transform: translateY(-1px);
}

#month-select {
  flex: 2;
}

#year-input {
  flex: 1;
}

#title-input {
  width: 100%;
}

/* Tabs */
.selection-tabs {
  display: flex;
  background: var(--bg-light);
  border-radius: var(--border-radius);
  padding: 4px;
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: transparent;
  border-radius: calc(var(--border-radius) - 4px);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn.active {
  background: var(--bg-white);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Calendar Grid */
.date-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  background: var(--bg-light);
  padding: 20px;
  border-radius: var(--border-radius);
  margin-bottom: 16px;
}

.calendar-header-day {
  text-align: center;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 12px 8px;
  font-size: 0.9rem;
}

.calendar-date {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
  background: var(--bg-white);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.calendar-date:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.calendar-date.selected {
  background: var(--secondary-gradient);
  color: white;
  border-color: #4facfe;
  box-shadow: var(--shadow-md);
}

.calendar-date.other-month {
  color: var(--text-muted);
  background: #f8f9fa;
}

.calendar-date.today {
  border-color: #667eea;
  font-weight: 700;
}

.calendar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.calendar-action-btn {
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  background: var(--bg-white);
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
}

.calendar-action-btn:hover {
  background: var(--bg-light);
  transform: translateY(-1px);
}

/* Day Selector */
.day-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.day-option {
  display: flex;
  align-items: center;
  font-weight: 500;
  cursor: pointer;
  padding: 16px 20px;
  border-radius: var(--border-radius);
  background: var(--bg-light);
  transition: var(--transition);
  border: 2px solid transparent;
}

.day-option:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
}

.day-option input[type="checkbox"] {
  margin-right: 12px;
  transform: scale(1.2);
}

.day-option input[type="checkbox"]:checked + span {
  color: #667eea;
  font-weight: 600;
}

/* Columns Section */
.columns-section {
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 20px;
  background: var(--bg-light);
}

.column-input {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.column-name {
  flex: 1;
}

.add-column-btn {
  background: var(--success-gradient);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.add-column-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.add-column-btn span {
  font-size: 1.2rem;
}

#columns-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.column-item {
  display: flex;
  align-items: center;
  background: var(--bg-white);
  padding: 12px 16px;
  border-radius: 25px;
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.column-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.column-text {
  margin-right: 12px;
  font-weight: 500;
  color: var(--text-primary);
}

.remove-column {
  background: var(--danger-gradient);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.remove-column:hover {
  transform: scale(1.1);
}

/* Generate Button */
.generate-btn {
  background: var(--primary-gradient);
  color: white;
  border: none;
  padding: 18px 36px;
  border-radius: var(--border-radius);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.generate-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

.btn-icon {
  font-size: 1.2rem;
}

.btn-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.generate-btn:hover .btn-shine {
  left: 100%;
}

/* Calendar Section */
.calendar-section {
  padding: 40px 30px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-light);
}

.result-card {
  background: var(--bg-white);
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

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

.calendar-title-section h2 {
  color: var(--text-primary);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.selected-dates-info {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.calendar-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 12px 20px;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.action-btn.export {
  background: var(--secondary-gradient);
  color: white;
}

.action-btn.print {
  background: var(--warning-gradient);
  color: white;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Table Styles */
.table-container {
  overflow-x: auto;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-white);
  border-radius: var(--border-radius);
  overflow: hidden;
}

th,
td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: var(--secondary-gradient);
  color: white;
  font-weight: 600;
  font-size: 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

tr:hover {
  background: var(--bg-light);
}

tr:last-child td {
  border-bottom: none;
}

.person-input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  background: var(--bg-white);
}

.person-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Loading and Notifications */
.export-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  color: white;
  font-size: 18px;
  flex-direction: column;
  backdrop-filter: blur(5px);
}

.export-loading .spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 24px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.notification {
  position: fixed;
  top: 24px;
  right: 24px;
  padding: 16px 24px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  z-index: 3000;
  font-weight: 600;
  max-width: 350px;
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

.notification.success {
  background: var(--success-gradient);
  color: white;
}

.notification.info {
  background: var(--secondary-gradient);
  color: white;
}

@keyframes slideIn {
  from {
    transform: translateX(100%) translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(0) translateY(0);
    opacity: 1;
  }
}

/* Export Styles */
.export-container {
  background: white;
  padding: 50px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  margin: 20px;
  font-family: "Inter", sans-serif;
  width: auto;
  min-width: 900px;
}

.export-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 40px;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.export-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.export-table th {
  background: var(--secondary-gradient);
  color: white;
  padding: 20px 18px;
  font-weight: 600;
  font-size: 16px;
  text-align: center;
  border: none;
}

.export-table td {
  padding: 18px;
  border-bottom: 1px solid #e8ecef;
  font-size: 15px;
  text-align: center;
  border: none;
}

.export-table tr:nth-child(even) {
  background-color: #f8f9fa;
}

.export-table tr:last-child td {
  border-bottom: none;
}

.export-date-cell {
  font-weight: 600;
  color: var(--text-primary);
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
  text-align: left !important;
  padding-left: 24px !important;
}

.export-person-cell {
  color: var(--text-secondary);
  font-weight: 500;
}

.export-watermark {
  text-align: center;
  margin-top: 30px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    margin: 0;
    border-radius: 0;
  }

  body {
    padding: 0;
  }

  header {
    padding: 20px;
  }

  .header-content {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .header-text h1 {
    font-size: 1.8rem;
  }

  .form-section,
  .calendar-section {
    padding: 20px 15px;
  }

  .form-card,
  .result-card {
    padding: 20px 15px;
  }

  .date-inputs {
    flex-direction: column;
  }

  .day-selector {
    grid-template-columns: 1fr;
  }

  .calendar-header {
    flex-direction: column;
    align-items: center;
  }

  .calendar-title-section {
    text-align: center;
  }

  .calendar-actions {
    width: 100%;
    justify-content: center;
  }

  .action-btn {
    width: 100%;
    justify-content: center;
  }

  .date-calendar {
    padding: 10px;
    gap: 4px;
  }

  .calendar-header-day {
    font-size: 0.7rem;
    padding: 8px 4px;
  }

  .calendar-date {
    font-size: 0.8rem;
  }

  .column-input {
    flex-direction: column;
  }

  .add-column-btn {
    margin-top: 10px;
  }

  table {
    font-size: 14px;
  }

  th,
  td {
    padding: 10px 8px;
  }

  .person-input {
    padding: 8px;
    font-size: 13px;
  }

  .notification {
    left: 20px;
    right: 20px;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .header-text h1 {
    font-size: 1.5rem;
  }

  .header-text p {
    font-size: 0.9rem;
  }

  .header-icon {
    font-size: 2rem;
  }

  .form-group label {
    font-size: 1rem;
  }

  .calendar-title-section h2 {
    font-size: 1.5rem;
  }

  .generate-btn {
    padding: 14px 20px;
    font-size: 16px;
  }

  .tab-btn {
    padding: 10px;
    font-size: 0.9rem;
  }

  .day-option {
    padding: 12px;
  }

  .column-item {
    width: 100%;
  }
}

@media print {
  body {
    background: white;
    padding: 0;
  }

  .container {
    box-shadow: none;
    border-radius: 0;
  }

  .form-section {
    display: none;
  }

  .calendar-actions {
    display: none;
  }

  .calendar-section {
    padding: 20px 0;
    background: white;
  }
}
