/* Layout & Grid */
.tool-container {
    padding: 0;
    max-width: 1400px;
    margin: 0 auto;
}

.glass-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    min-height: 500px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    transition: grid-template-columns 0.4s ease; /* Smooth transition */
}

/* State: Settings Closed */
.glass-grid.settings-closed {
    grid-template-columns: 0px 1fr;
}

@media (max-width: 992px) {
    .glass-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr; /* Stack vertically */
        transition: grid-template-rows 0.4s ease;
    }
    
    .glass-grid.settings-closed {
        grid-template-columns: 1fr;
        grid-template-rows: 0px 1fr; /* Collapse height on mobile */
    }
}

/* SIDEBAR CONTROLS */
.controls-panel {
    background: #fff;
    border-right: 1px solid #e1e4e8;
    padding: 20px; /* Reduced from 30px */
    overflow-y: auto;
    max-height: 100vh;
    
    /* Ensure content doesn't break layout during transition */
    width: 100%; 
    min-width: 350px; 
    box-sizing: border-box;
    opacity: 1;
    transition: opacity 0.2s ease, visibility 0.2s;
}

/* Collapsible Sections */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 10px 0;
    transition: opacity 0.2s;
}

.section-header:hover {
    opacity: 0.7;
}

.section-header h2, .section-header h3 {
    margin: 0;
    border: none;
    padding: 0;
}

.section-header i {
    transition: transform 0.3s ease;
    color: #3498db;
}

.section-content {
    max-height: 1000px; /* Large enough */
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
    opacity: 1;
    margin-top: 20px;
}

.collapsible-section.collapsed .section-content {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.collapsible-section.collapsed .section-header i {
    transform: rotate(-90deg);
}

.controls-panel h2 {
    font-size: 1.3rem;
    color: #2c3e50;
    font-weight: 700;
}

.controls-panel h3 {
    font-size: 1.1rem;
    color: #2c3e50;
    font-weight: 700;
}

.control-group {
    margin-bottom: 25px;
}

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

.control-header label {
    font-weight: 600;
    color: #34495e;
    font-size: 0.9rem;
}

.control-header .value-display {
    font-family: monospace;
    color: #3498db;
    background: #ebf5fb;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    margin-top: -7px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #dfe6e9;
    border-radius: 2px;
}

.color-picker-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-picker-wrapper {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #dfe6e9;
    cursor: pointer;
}

.color-picker-wrapper input[type="color"] {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    cursor: pointer;
    border: none;
}

/* PREVIEW AREA */
.preview-panel {
    background-color: #2c3e50;
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,1) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,1) 0, transparent 50%);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px; /* Reduced padding */
    overflow: hidden;
}

/* Toggle Button Style */
.btn-settings-toggle {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-settings-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.btn-settings-toggle.active {
    background: #fff;
    color: #333;
}

/* Animated Background Shapes - Reduced Sizes */
.shape {
    position: absolute;
    z-index: 0;
    animation: float 10s infinite ease-in-out alternate;
}

.shape-1 {
    top: 15%;
    left: 15%;
    width: 220px; /* Reduced from 300px */
    height: 220px;
    background: #3498db;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
}

.shape-2 {
    bottom: 15%;
    right: 15%;
    width: 180px; /* Reduced from 250px */
    height: 180px;
    background: #9b59b6;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation-delay: -5s;
}

.shape-3 {
    top: 40%;
    left: 60%;
    width: 100px; /* Reduced from 150px */
    height: 100px;
    background: #e74c3c;
    border-radius: 50%;
    animation-delay: -2s;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(20px, 40px) rotate(10deg); }
}

/* THE GLASS CARD - Reduced Sizes */
.glass-element {
    position: relative;
    z-index: 10;
    width: 320px; /* Reduced from 400px */
    min-height: 180px; /* Reduced from 250px */
    padding: 30px; /* Reduced from 40px */
    border-radius: 16px;
    color: white;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.2s ease;
    
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-content h3 {
    margin: 0 0 10px 0;
    font-size: 1.6rem; /* Slightly smaller */
    font-weight: 700;
}

.glass-content p {
    font-size: 0.95rem; /* Slightly smaller */
    line-height: 1.5;
    opacity: 0.9;
}

.glass-badge {
    display: inline-block;
    padding: 5px 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    font-size: 0.75rem;
    margin-bottom: 15px;
    border: 1px solid rgba(255,255,255,0.1);
}

/* CODE OUTPUT */
.code-wrapper {
    position: relative;
    z-index: 20;
    margin-top: 30px; /* Reduced from 40px */
    width: 100%;
    max-width: 500px;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1e1e1e;
    padding: 10px 20px;
    border-radius: 8px 8px 0 0;
    color: #ccc;
    font-size: 0.9rem;
}

.code-output {
    background: #282c34;
    padding: 20px;
    border-radius: 0 0 8px 8px;
    color: #61dafb;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-all;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.btn-copy {
    background: transparent;
    border: 1px solid #ccc;
    color: #ccc;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: #fff;
    color: #1e1e1e;
}

/* CTA Styles reused */
.cta-security {
  margin: 50px 0 0 0;
  background: linear-gradient(90deg, #23c6fa 10%, #23315a 100%);
  color: #fff;
  box-shadow: 0 10px 32px rgba(35,49,90,0.09);
  padding: 0;
}

.cta-security-inner {
  display: flex;
  align-items: center;
  gap: 36px;
  padding: 38px 36px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.cta-security-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.cta-btn.btn-accent {
  background: linear-gradient(90deg, #fd746c, #ff9068);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 18px 30px;
  box-shadow: 0 4px 16px rgba(253,116,108,0.12);
  text-decoration: none;
  display: inline-block;
}

/* Back Button Standard */
.btn-back-tools {
    margin-bottom: 30px;
    background-color: #f1f3f5;
    color: #495057;
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background-color 0.2s;
}
.btn-back-tools:hover {
    background-color: #e9ecef;
}
