/* Data Center Designer Styles */
:root {
  --primary-color: #d83f1e;
  --secondary-color: #b8321a;
  --accent-color: #ff5722;
  --dark-color: #2d1b0f;
  --gray-color: #6b4226;
  --light-gray: #f5f1ee;
  --lighter-gray: #faf7f4;
  --white: #ffffff;
  --gradient-primary: linear-gradient(135deg, #d83f1e 0%, #ff5722 100%);
  --shadow: 0 4px 6px -1px rgba(216, 63, 30, 0.2), 0 2px 4px -1px rgba(216, 63, 30, 0.1);
  --shadow-sm: 0 1px 3px 0 rgba(216, 63, 30, 0.15), 0 1px 2px 0 rgba(216, 63, 30, 0.1);
  --transition: all 0.3s ease;
  --font-primary: 'Poppins', sans-serif;
}

.data-center-designer {
  padding: 60px 0;
  background-color: var(--lighter-gray);
}

.designer-header {
  text-align: center;
  margin-bottom: 40px;
}

.designer-header h1 {
  font-size: 2.5rem;
  margin-bottom: 15px;
  color: var(--dark-color);
}

.designer-header p {
  color: var(--gray-color);
  font-size: 1.1rem;
}

.designer-sidebar {
  background-color: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 30px;
  margin-bottom: 30px;
}

.designer-tabs {
  display: flex;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--light-gray);
}

.designer-tabs .tab-btn {
  padding: 10px 15px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-family: var(--font-primary);
  font-weight: 500;
  color: var(--gray-color);
  cursor: pointer;
  transition: var(--transition);
}

.designer-tabs .tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.tab-content {
  display: none;
}

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

.type-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 30px 0;
}

.type-card {
  padding: 25px;
  border: 1px solid var(--light-gray);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.type-card:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

.type-card.active {
  border-color: var(--primary-color);
  background-color: rgba(37, 99, 235, 0.05);
}

.type-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.type-card h4 {
  margin-bottom: 10px;
  color: var(--dark-color);
}

.type-card p {
  color: var(--gray-color);
  font-size: 0.9rem;
}

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

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

input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--light-gray);
  outline: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
}

select, textarea, input[type="text"] {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--light-gray);
  border-radius: 6px;
  font-family: var(--font-primary);
  transition: var(--transition);
}

select:focus, textarea:focus, input[type="text"]:focus {
  border-color: var(--primary-color);
  outline: none;
}

.summary-card {
  background-color: rgba(37, 99, 235, 0.05);
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--light-gray);
}

.summary-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.designer-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
}

.btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-family: var(--font-primary);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

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

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

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background-color: rgba(37, 99, 235, 0.1);
}

#data-center-list {
  margin-top: 20px;
}

.dc-card {
  background-color: var(--white);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: var(--shadow-sm);
}

.dc-card h4 {
  color: var(--dark-color);
  margin-bottom: 10px;
}

.dc-card p {
  margin-bottom: 5px;
  color: var(--gray-color);
  font-size: 0.9rem;
}

.dc-card p strong {
  color: var(--dark-color);
}

.dc-actions {
  margin-top: 15px;
  display: flex;
  justify-content: flex-end;
}

.dc-delete {
  background-color: #e11d48;
  color: var(--white);
  border: none;
  padding: 8px 15px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-primary);
  transition: var(--transition);
}

.dc-delete:hover {
  background-color: #be123c;
}

/* Container Layout */
.designer-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: start;
}

/* Preview Section Styles */
.designer-preview {
  background-color: var(--white);
  border-radius: 15px;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: sticky;
  top: 20px;
}

.preview-header {
  padding: 25px 30px;
  border-bottom: 1px solid var(--light-gray);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--gradient-primary);
  color: var(--white);
}

.preview-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.view-options {
  display: flex;
  gap: 10px;
}

.view-btn {
  padding: 8px 15px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  color: var(--white);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
}

.view-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

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

.preview-container {
  height: 400px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

/* 3D Visualization */
.preview-3d {
  width: 100%;
  height: 100%;
  display: none;
  position: relative;
  perspective: 1000px;
  overflow: hidden;
}

.preview-3d.active {
  display: block;
}

.datacenter-3d {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  perspective: 1200px;
  perspective-origin: 50% 30%;
  animation: rotate3d 30s infinite linear;
}

@keyframes rotate3d {
  0% { transform: rotateY(0deg) rotateX(15deg); }
  100% { transform: rotateY(360deg) rotateX(15deg); }
}

.datacenter-floor {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%) rotateX(90deg);
  width: 300px;
  height: 200px;
  background: 
    linear-gradient(90deg, #333 1px, transparent 1px),
    linear-gradient(180deg, #333 1px, transparent 1px),
    #2a2a2a;
  background-size: 20px 20px;
  border: 2px solid #444;
  box-shadow: 0 0 20px rgba(216, 63, 30, 0.3);
}

.server-rack {
  position: absolute;
  width: 20px;
  height: 60px;
  background: var(--gradient-primary);
  border-radius: 2px;
  box-shadow: 
    0 0 10px rgba(216, 63, 30, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.3);
  animation: pulse 2s infinite ease-in-out;
  transform-style: preserve-3d;
  /* Add depth with pseudo-elements */
}

.server-rack::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, rgba(216, 63, 30, 0.2), rgba(255, 87, 34, 0.2));
  border-radius: 4px;
  z-index: -1;
  transform: translateZ(-5px);
}

.server-rack::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent);
  border-radius: 2px;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(216, 63, 30, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.1); }
  50% { box-shadow: 0 0 20px rgba(216, 63, 30, 0.8), inset 0 2px 4px rgba(255, 255, 255, 0.2); }
}

.rack-lights {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #00ff00;
  animation: blink 1.5s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.3; }
}

.cooling-unit {
  position: absolute;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
  border-radius: 50%;
  box-shadow: 
    0 0 15px rgba(74, 144, 226, 0.6),
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 2px 6px rgba(255, 255, 255, 0.2);
  transform-style: preserve-3d;
  /* Remove the old spin animation as we'll use JavaScript for slow rotation */
}

/* Add 3D depth effect to cooling units */
.cooling-unit::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  background: radial-gradient(circle, rgba(74, 144, 226, 0.1), rgba(74, 144, 226, 0.05));
  border-radius: 50%;
  z-index: -1;
  transform: translateZ(-10px);
}

.cooling-unit::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  height: 60%;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
  border-radius: 50%;
}

/* Floorplan View */
.preview-floorplan {
  width: 100%;
  height: 100%;
  display: none;
  background: var(--white);
  position: relative;
  overflow: hidden;
}

.preview-floorplan.active {
  display: block;
}

.floorplan-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(to right, #e0e0e0 1px, transparent 1px),
    linear-gradient(to bottom, #e0e0e0 1px, transparent 1px);
  background-size: 20px 20px;
}

.floorplan-rack {
  position: absolute;
  background: var(--gradient-primary);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 10px;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
}

.floorplan-rack:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow);
}

.floorplan-cooling {
  position: absolute;
  background: #4a90e2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 12px;
  transition: var(--transition);
  cursor: pointer;
}

.floorplan-cooling:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow);
}

/* Placeholder styles */
.placeholder-3d, .placeholder-floorplan {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
}

.placeholder-3d i, .placeholder-floorplan i {
  font-size: 3rem;
  margin-bottom: 15px;
  color: var(--primary-color);
}

/* Specifications Cards */
.preview-specs {
  padding: 25px 30px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  background: var(--lighter-gray);
}

.spec-card {
  text-align: center;
  padding: 20px;
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.spec-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.spec-card h4 {
  margin: 0 0 10px 0;
  color: var(--gray-color);
  font-size: 0.9rem;
  font-weight: 500;
}

.spec-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* Form enhancements */
.range-value {
  text-align: center;
  margin-top: 8px;
  font-weight: 600;
  color: var(--primary-color);
}

.form-group label {
  position: relative;
}

.form-group input[type="checkbox"] {
  margin-right: 8px;
  accent-color: var(--primary-color);
}

/* Enhanced buttons */
.btn-secondary {
  background: var(--gradient-primary);
  color: var(--white);
  border: none;
}

.btn-secondary:hover {
  background: var(--secondary-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* Loading states */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(216, 63, 30, 0.2), transparent);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Professional 3D Animations */

/* Server Rack Animations */
@keyframes rackBreathing {
  0%, 100% { transform: translateZ(var(--z-pos)) scale(1); }
  50% { transform: translateZ(var(--z-pos)) scale(1.02); }
}

@keyframes serverLedBlink {
  0%, 90% { opacity: 1; }
  95%, 100% { opacity: 0.3; }
}

@keyframes powerPulse {
  0%, 100% { 
    box-shadow: 0 0 8px #00ff88;
    transform: scale(1);
  }
  50% { 
    box-shadow: 0 0 15px #00ff88, 0 0 25px #00ff88;
    transform: scale(1.1);
  }
}

@keyframes dataFlowAnimation {
  0% { 
    background: linear-gradient(to bottom, transparent, transparent, transparent);
    transform: translateX(-50%) translateY(-20px);
  }
  50% { 
    background: linear-gradient(to bottom, transparent, #00aaff, transparent);
    transform: translateX(-50%) translateY(0px);
  }
  100% { 
    background: linear-gradient(to bottom, transparent, transparent, transparent);
    transform: translateX(-50%) translateY(20px);
  }
}

/* Cooling Unit Animations */
@keyframes fanRotation {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes coolingHover {
  0%, 100% { transform: translateZ(var(--z-pos)) translateY(0px); }
  50% { transform: translateZ(var(--z-pos)) translateY(-3px); }
}

@keyframes airflowParticle {
  0% {
    opacity: 0;
    transform: translate(25px, 25px) scale(0);
  }
  20% {
    opacity: 1;
    transform: translate(20px, 20px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-30px, -30px) scale(0.5);
  }
}

@keyframes tempPulse {
  0%, 100% { 
    transform: scale(1);
    opacity: 1;
  }
  50% { 
    transform: scale(1.3);
    opacity: 0.7;
  }
}

/* Enhanced 3D Animations for Planes */
@keyframes rackGroundPlane {
  0%, 100% { transform: translateY(0) rotateX(0deg); }
  50% { transform: translateY(-2px) rotateX(1deg); }
}

@keyframes coolingElevatedPlane {
  0%, 100% { transform: translateY(0) rotateX(0deg) rotateZ(0deg); }
  25% { transform: translateY(-1px) rotateX(0.5deg) rotateZ(0.5deg); }
  75% { transform: translateY(1px) rotateX(-0.5deg) rotateZ(-0.5deg); }
}

/* Enhance depth perception */
.server-rack {
  animation: pulse 2s infinite ease-in-out, rackGroundPlane 8s infinite ease-in-out;
}

.cooling-unit {
  animation: coolingElevatedPlane 6s infinite ease-in-out;
}

/* Add subtle parallax effect to containers */
#server-racks-container {
  transform-style: preserve-3d;
}

#cooling-units-container {
  transform-style: preserve-3d;
}