/* Tavira Croodle - Improved CSS */

/* ======== VARIABLES ======== */
:root {
  --primary-color: #4a6baf;
  --secondary-color: #5d7fc7;
  --accent-color: #e67e22;
  --light-bg: #f8f9fa;
  --dark-bg: #2c3e50;
  --success-color: #27ae60;
  --warning-color: #f39c12;
  --danger-color: #e74c3c;
  --text-color: #34495e;
  --light-text: #ecf0f1;
  --border-radius: 8px;
  --box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  --header-height: 70px;
  --content-max-width: 1200px;
}

/* ======== BASE STYLES ======== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--light-bg);
  color: var(--text-color);
  font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  background-image: url('https://tavira.group/wp-content/uploads/2018/10/home-hero.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  position: relative;
}

.container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 15px;
  width: 100%;
}

/* ======== HEADER ======== */
#header, .navbar {
  background-color: rgba(255, 255, 255, 0.9);
  padding: 18px 25px;
  margin-bottom: 30px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
}


.logo, .navbar-brand, h1.logo, h1.logo a {
  margin: 0;
  font-weight: 700;
  color: var(--primary-color);
  font-size: 2.3rem;
  text-decoration: none;
  line-height: 1.2;
}

.language-select {
  margin: 0;
  padding: 8px;
  border-radius: var(--border-radius);
  border: 1px solid rgba(0, 0, 0, 0.1);
  background-color: white;
  color: var(--text-color);
  font-size: 16px;
  cursor: pointer;
}

/* ======== CONTENT BOX ======== */
.box {
  padding: 25px;
  margin-bottom: 25px;
  background-color: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: transform 0.2s ease-in-out;
  overflow: hidden;
}

/* ======== FORMS ======== */
.form-group {
  margin-bottom: 20px;
}

.form-control, 
select.form-control,
.simple-select {
  border-radius: var(--border-radius);
  box-shadow: none;
  border: 1px solid rgba(0, 0, 0, 0.15);
  padding: 12px 15px;
  height: auto;
  width: 100%;
  max-width: 100%;
  font-size: 16px;
  background-color: white;
  transition: all 0.3s ease;
}

.form-control:focus,
select.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(74, 107, 175, 0.15);
  outline: none;
}

/* Style for select dropdown arrow */
select.form-control,
.simple-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a6baf' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 16px;
  padding-right: 40px;
}

.control-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-color);
}

.has-success .control-label {
  color: var(--success-color);
}

.has-error .control-label {
  color: var(--danger-color);
}

/* ======== FORM STEPS NAVIGATION ======== */
.form-steps,
.btn-group-justified {
  display: flex;
  width: 100%;
  margin-bottom: 30px;
  overflow: hidden;
  border-radius: var(--border-radius);
  background-color: white;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
}

.form-steps .btn-group,
.btn-group-justified .btn-group {
  flex: 1;
  display: flex;
}

.form-steps .btn,
.btn-group-justified .btn {
  flex: 1;
  text-align: center;
  padding: 15px 5px;
  border: none;
  border-radius: 0;
  background-color: #f8f9fa;
  color: var(--text-color);
  font-weight: 500;
  transition: all 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  box-shadow: none;
  margin: 0;
  font-size: 15px;
}

.form-steps .btn-primary,
.btn-group-justified .btn-primary {
  background-color: var(--primary-color);
  color: white;
  position: relative;
  font-weight: 600;
}

.form-steps .btn-primary:after,
.btn-group-justified .btn-primary:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--accent-color);
}

.form-steps .btn:hover,
.btn-group-justified .btn:hover {
  background-color: #e9ecef;
}

.form-steps .btn-primary:hover,
.btn-group-justified .btn-primary:hover {
  background-color: var(--secondary-color);
}

/* Fix button group borders and spacing */
.btn-group-justified .btn-group:not(:last-child) .btn {
  border-right: 1px solid rgba(0,0,0,0.05);
}

/* Add active indicator */
.btn-group-justified .btn-primary:before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0; 
  height: 0; 
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--accent-color);
}

/* ======== BUTTONS ======== */
.btn {
  border-radius: var(--border-radius);
  padding: 12px 20px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-block;
  text-align: center;
  cursor: pointer;
  border: none;
  text-decoration: none;
  font-size: 16px;
  position: relative;
  overflow: hidden;
}

.btn-default, 
.btn-secondary {
  background-color: #f8f9fa;
  color: var(--text-color);
  border: 1px solid #ddd;
}

.btn-default:hover, 
.btn-secondary:hover {
  background-color: #e9ecef;
}

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

.btn-primary:hover, 
.btn-primary:focus, 
.btn-primary:active {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:disabled,
.btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ======== NAVIGATION BUTTONS ======== */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
}

.col-xs-6, 
.col-md-4, 
.col-md-8 {
  position: relative;
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
}

.col-xs-6 {
  flex: 0 0 50%;
  max-width: 50%;
}

.text-right {
  text-align: right;
}

.prev, 
.next {
  margin-top: 20px;
  min-width: 120px;
  display: block;
}

/* ======== POLL PARTICIPATION STYLES ======== */
/* Main poll container */
.selections {
  margin: 0 auto;
  max-width: 800px;
  padding: 15px;
}

/* Form groups in poll */
.selections .form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 25px;
  background: white;
  border-radius: var(--border-radius);
  padding: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Date/time labels */
.selections .control-label {
  width: 100%;
  text-align: center;
  margin-bottom: 15px;
  font-weight: 600;
  color: var(--primary-color);
  font-size: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding-bottom: 10px;
}

/* Radio button container */
.selections .col-md-8,
.selections .col-md-4 {
  width: 100%;
  max-width: 100%;
  text-align: center;
}

/* Radio buttons layout */
.selections .radio {
  display: inline-block;
  margin: 0 15px;
  padding: 10px 20px;
  border-radius: var(--border-radius);
  transition: all 0.2s ease;
}

.selections .radio:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

/* Yes/No radio buttons */
.selections .radio.yes,
.selections .radio.no {
  min-width: 100px;
}

.selections .radio label {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 500;
  font-size: 16px;
}

.selections .radio input[type="radio"] {
  margin-right: 8px;
}

/* Style thumbs up/down icons */
.selections .glyphicon {
  margin-right: 8px;
  font-size: 18px;
}

.selections .radio.yes .glyphicon-thumbs-up {
  color: var(--success-color);
}

.selections .radio.no .glyphicon-thumbs-down {
  color: var(--danger-color);
}

/* Style active state */
.selections .radio input[type="radio"]:checked + .glyphicon {
  transform: scale(1.2);
}

/* Improve name field */
input[type="text"].form-control {
  height: 50px;
  padding: 12px 15px;
  font-size: 16px;
  border-radius: var(--border-radius);
  border: 1px solid rgba(0, 0, 0, 0.15);
  width: 100%;
  margin-bottom: 20px;
}

/* Poll header styling */
.poll-header {
  text-align: center;
  margin-bottom: 30px;
}

.poll-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.poll-description {
  color: var(--text-color);
  margin-bottom: 20px;
}

/* Poll navigation tabs */
.poll-tabs {
  display: flex;
  justify-content: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.poll-tabs .tab {
  padding: 12px 25px;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-color);
  position: relative;
  transition: all 0.2s ease;
}

.poll-tabs .tab.active {
  color: var(--primary-color);
}

.poll-tabs .tab.active:after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--primary-color);
}

/* Link sharing box */
.share-link-box {
  background-color: white;
  border-radius: var(--border-radius);
  padding: 20px;
  margin: 20px 0;
  box-shadow: var(--box-shadow);
}

.share-link-box h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
}

.share-link-box .link-input {
  display: flex;
  margin-bottom: 10px;
}

.share-link-box input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--border-radius) 0 0 var(--border-radius);
  font-size: 14px;
}

.share-link-box .copy-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  cursor: pointer;
}

/* Responsive styles for poll */
@media (max-width: 767px) {
  .selections .form-group {
    padding: 15px 10px;
  }
  
  .selections .radio {
    margin: 0 10px;
    padding: 8px 15px;
  }
  
  .selections .control-label {
    font-size: 15px;
  }
}

.calendar-container {
  margin-bottom: 20px;
}

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

.calendar-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-color);
}

.calendar-nav {
  display: flex;
  gap: 10px;
}

.calendar-nav-btn {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--border-radius);
  padding: 5px 10px;
  cursor: pointer;
  color: var(--primary-color);
  transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
  background-color: var(--light-bg);
}

.calendar-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 2px;
}

.calendar-table th {
  text-align: center;
  padding: 8px;
  font-weight: 500;
  color: var(--primary-color);
}

.calendar-table td {
  text-align: center;
  padding: 0;
}

.calendar-day {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 40px;
  width: 40px;
  margin: 0 auto;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-day:hover {
  background-color: rgba(74, 107, 175, 0.1);
}

.calendar-day.selected {
  background-color: var(--primary-color);
  color: white;
}

.calendar-day.today {
  border: 2px solid var(--primary-color);
}

.calendar-day.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Date picker input styling */
.datepicker-input {
  position: relative;
}

.datepicker-input input {
  padding-right: 40px;
}

.datepicker-input:after {
  content: "";
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a6baf' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3e%3c/rect%3e%3cline x1='16' y1='2' x2='16' y2='6'%3e%3c/line%3e%3cline x1='8' y1='2' x2='8' y2='6'%3e%3c/line%3e%3cline x1='3' y1='10' x2='21' y2='10'%3e%3c/line%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}

/* Time picker styling */
.time-picker {
  display: flex;
  gap: 10px;
  align-items: center;
}

.time-picker select {
  min-width: 70px;
}

.time-separator {
  font-weight: bold;
  color: var(--text-color);
}

/* Datetime range selector */
.datetime-range {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
}

.datetime-range-separator {
  font-weight: bold;
  color: var(--text-color);
}

/* ======== RESPONSIVE STYLES ======== */
@media (max-width: 991px) {
  .form-steps .btn,
  .btn-group-justified .btn {
    font-size: 14px;
    padding: 12px 8px;
  }
  
  .box {
    padding: 20px;
  }
}

@media (max-width: 767px) {
  #header, .navbar {
    justify-content: center;
    text-align: center;
    padding: 15px 10px;
  }
  
  #header h1.logo,
  .navbar-brand {
    margin-bottom: 10px;
  }
  
  .form-inline {
    margin: 10px auto;
    width: 100%;
    display: flex;
    justify-content: center;
  }
  
  .language-select {
    width: 80%;
    max-width: 250px;
  }
  
  /* Better tablet/mobile form steps */
  .form-steps,
  .btn-group-justified {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    margin-bottom: 20px;
    padding-bottom: 5px; /* For scrollbar */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  
  .form-steps .btn-group,
  .btn-group-justified .btn-group {
    flex: 0 0 auto;
    min-width: 120px;
  }
  
  .form-steps .btn,
  .btn-group-justified .btn {
    text-align: center;
    padding: 10px 15px;
    font-size: 14px;
  }
  
  .form-horizontal .control-label {
    text-align: left;
    margin-bottom: 8px;
  }
  
  .col-xs-6, 
  .col-md-4, 
  .col-md-8 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  .col-xs-6.text-right {
    text-align: left;
  }
  
  .prev, 
  .next {
    width: 100%;
  }
  
  .form-group.poll-type {
    display: flex;
    flex-direction: column;
  }
  
  .box {
    padding: 18px 15px;
    margin-left: 5px;
    margin-right: 5px;
  }
  
  /* Fix form layout on mobile */
  .form-horizontal .form-group {
    display: flex;
    flex-direction: column;
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 480px) {
  .logo, .navbar-brand, h1.logo, h1.logo a {
    font-size: 1.8rem;
  }
  
  .form-steps .btn,
  .btn-group-justified .btn {
    padding: 10px 8px;
    font-size: 13px;
  }
  
  .box {
    padding: 15px 12px;
  }
  
  .control-label,
  .form-control,
  select.form-control {
    font-size: 15px;
  }
  
  /* Improve form elements spacing */
  .form-group {
    margin-bottom: 20px;
  }
  
  /* Make buttons more touchable */
  .btn {
    padding: 12px 15px;
    min-height: 50px;
  }
  
  /* Better dropdown select */
  select.form-control,
  .simple-select {
    height: 50px;
  }
  
  /* Fix datetime pickers in small screens */
  .datetime-range {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ======== FIXES FOR SPECIFIC ISSUES ======== */
/* Fix for overlapping buttons */
@media (max-width: 767px) {
  .row {
    flex-direction: column;
  }
  
  .col-xs-6 {
    margin-bottom: 10px;
  }
  
  .prev,
  .next {
    margin-top: 5px;
  }
}

/* Fix for navigation steps - using horizontal scroll instead of dropdown */
@media (max-width: 767px) {
  /* We're now using horizontal scrolling for steps (see media query above)
   * so we don't hide the steps navigation anymore
   */
   
  /* Add visual indicator that user can scroll */
  .form-steps:after,
  .btn-group-justified:after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,0.9));
    pointer-events: none;
    z-index: 5;
  }
  
  /* Improve scrollbar appearance */
  .form-steps::-webkit-scrollbar,
  .btn-group-justified::-webkit-scrollbar {
    height: 4px;
  }
  
  .form-steps::-webkit-scrollbar-track,
  .btn-group-justified::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
  }
  
  .form-steps::-webkit-scrollbar-thumb,
  .btn-group-justified::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
  }
}

/* Fix for form layout */
@media (max-width: 767px) {
  .form-horizontal {
    display: flex;
    flex-direction: column;
  }
  
  .form-group {
    margin-bottom: 15px;
  }
  
  .form-horizontal .col-md-4,
  .form-horizontal .col-md-8 {
    padding: 0;
  }
}