/* KaiMail v2.0 - Softkey Navigation Styles */

/* Softkey Bar */
.softkey-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
  border-top: 1px solid #dee2e6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 1000;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
}

/* Softkey Buttons */
.softkey {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
  background: transparent;
  border: none;
  outline: none;
  position: relative;
}

.softkey:active {
  transform: scale(0.95);
  background-color: rgba(0,120,212,0.1);
}

.softkey.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Softkey Icons */
.softkey-icon {
  font-size: 18px;
  margin-bottom: 2px;
  color: #495057;
  transition: color 0.2s ease;
}

.softkey:active .softkey-icon {
  color: #0078d4;
}

/* Softkey Labels */
.softkey-label {
  font-size: 10px;
  font-weight: 500;
  color: #6c757d;
  text-align: center;
  line-height: 1.2;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.softkey:active .softkey-label {
  color: #0078d4;
}

/* Left Softkey (Back/Cancel) */
.softkey-left {
  justify-content: flex-start;
  text-align: left;
}

.softkey-left .softkey-icon {
  color: #dc3545;
}

.softkey-left:active .softkey-icon {
  color: #c82333;
}

.softkey-left .softkey-label {
  color: #dc3545;
}

.softkey-left:active .softkey-label {
  color: #c82333;
}

/* Center Softkey (Select/OK) */
.softkey-center {
  background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
  color: white;
  border-radius: 12px;
  margin: 0 8px;
  min-width: 80px;
  box-shadow: 0 2px 4px rgba(0,120,212,0.3);
}

.softkey-center:active {
  background: linear-gradient(135deg, #005a9e 0%, #004578 100%);
  transform: scale(0.95);
  box-shadow: 0 1px 2px rgba(0,120,212,0.3);
}

.softkey-center .softkey-icon {
  color: white;
  font-size: 20px;
}

.softkey-center .softkey-label {
  color: white;
  font-weight: 600;
  font-size: 11px;
}

.softkey-center.disabled {
  background: #adb5bd;
  box-shadow: none;
}

/* Right Softkey (Options/Menu) */
.softkey-right {
  justify-content: flex-end;
  text-align: right;
}

.softkey-right .softkey-icon {
  color: #28a745;
}

.softkey-right:active .softkey-icon {
  color: #218838;
}

.softkey-right .softkey-label {
  color: #28a745;
}

.softkey-right:active .softkey-label {
  color: #218838;
}

/* Softkey States */
.softkey.primary {
  background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
  color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,120,212,0.2);
}

.softkey.primary:active {
  background: linear-gradient(135deg, #005a9e 0%, #004578 100%);
}

.softkey.primary .softkey-icon,
.softkey.primary .softkey-label {
  color: white;
}

.softkey.secondary {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
}

.softkey.secondary:active {
  background-color: #e9ecef;
  border-color: #adb5bd;
}

.softkey.danger {
  background-color: #dc3545;
  color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(220,53,69,0.2);
}

.softkey.danger:active {
  background-color: #c82333;
}

.softkey.danger .softkey-icon,
.softkey.danger .softkey-label {
  color: white;
}

.softkey.success {
  background-color: #28a745;
  color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(40,167,69,0.2);
}

.softkey.success:active {
  background-color: #218838;
}

.softkey.success .softkey-icon,
.softkey.success .softkey-label {
  color: white;
}

/* Softkey Animations */
.softkey-bar {
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Softkey Ripple Effect */
.softkey::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background-color: rgba(255,255,255,0.3);
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
  pointer-events: none;
}

.softkey:active::before {
  width: 100px;
  height: 100px;
}

/* Context-Specific Softkeys */
.softkey-bar.login-context .softkey-center {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.softkey-bar.login-context .softkey-center:active {
  background: linear-gradient(135deg, #218838 0%, #1c7430 100%);
}

.softkey-bar.loading-context .softkey-center {
  background: #6c757d;
  cursor: not-allowed;
}

.softkey-bar.dashboard-context .softkey-left .softkey-icon {
  color: #fd7e14;
}

.softkey-bar.dashboard-context .softkey-left .softkey-label {
  color: #fd7e14;
}

.softkey-bar.dashboard-context .softkey-right .softkey-icon {
  color: #6f42c1;
}

.softkey-bar.dashboard-context .softkey-right .softkey-label {
  color: #6f42c1;
}

/* Accessibility */
.softkey:focus {
  outline: 2px solid #0078d4;
  outline-offset: 2px;
}

.softkey:focus .softkey-icon,
.softkey:focus .softkey-label {
  color: #0078d4;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .softkey-bar {
    border-top: 2px solid #000;
    background: #fff;
  }
  
  .softkey {
    border: 1px solid #000;
  }
  
  .softkey-center {
    background: #000;
    color: #fff;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .softkey-bar {
    animation: none;
  }
  
  .softkey,
  .softkey-icon,
  .softkey-label {
    transition: none;
  }
  
  .softkey::before {
    display: none;
  }
}

/* Small Screen Adjustments */
@media screen and (max-width: 320px) {
  .softkey-bar {
    height: 56px;
    padding: 0 8px;
  }
  
  .softkey {
    min-height: 44px;
    padding: 2px 4px;
  }
  
  .softkey-icon {
    font-size: 16px;
  }
  
  .softkey-label {
    font-size: 9px;
    max-width: 50px;
  }
  
  .softkey-center {
    min-width: 70px;
    margin: 0 4px;
  }
}

/* Landscape Orientation */
@media screen and (orientation: landscape) {
  .softkey-bar {
    height: 50px;
  }
  
  .softkey {
    min-height: 40px;
  }
  
  .softkey-icon {
    font-size: 16px;
    margin-bottom: 1px;
  }
  
  .softkey-label {
    font-size: 9px;
  }
}