/***********************
BASE RESET & TYPOGRAPHY
***********************/
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 18px;
    line-height: 1.618;
    color: #031326;
    background: #fcfcf9;
    min-height: 100vh;
    letter-spacing: 0.3px;
}

/***********************
CONTAINER
***********************/
.podcast-name-generator-app {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 100vh;
}

/***********************
HEADER
***********************/
.app-header {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    flex-direction: row;
    background: linear-gradient(135deg, #2B7CE9 0%, #1E5DBF 100%);
    border-radius: 30px;
    color: #fff;
    box-shadow: 0 15px 40px rgba(43,124,233,.25);
    margin: 30px 0;
	padding: 20px 20px 20px 45px;
}

.app-logo {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    flex-shrink: 0;
    object-fit: cover;
    max-width: 100%;
}

.app-header-text {
    flex-shrink: 1;
    min-width: 0;
}

.app-header-text h1 {
    font-size: 37px;
    font-weight: 700;
    letter-spacing: 0px;
	line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    color: white;
}

.app-header-text p {
    font-size: 22px;
    font-weight: 500;
    opacity: .95;
    line-height: 1.4;
    margin: 10px 0;
    color: white;
}

/***********************
MAIN CONTENT
***********************/
.main-content {
    padding: 0;
}

.welcome-content {
    text-align: left;
    margin: 0 auto 30px;
    background: #fff;
    border: 1px solid #E3EDFF;
    border-radius: 20px;
    padding: 36px 30px 26px 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,.06);
    transition: all .25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.welcome-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2B7CE9, #1E5DBF);
}

.welcome-content:hover {
    box-shadow: 0 15px 40px rgba(0,0,0,.1);
    transform: translateY(-4px);
    border-color: #2B7CE9;
}

/***********************
FORM STYLES
***********************/
.generator-form h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #031326;
    line-height: 1.3;
    letter-spacing: 0.3px;
}

.form-description, .advanced-description {
    font-size: 19px;
    color: #3b3d3f;
    margin: 0 0 24px 0;
    line-height: 1.618;
    letter-spacing: 0.3px;
}

.generator-form-fields {
    display: flex;
    flex-direction: column;
    gap: 5px;
	margin-bottom: 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.form-label {
    font-size: 17px;
    font-weight: 500;
    color: #031326;
    margin-bottom: 8px;
}

.form-label .required {
    color: #e61e3c;
	font-size: 20px;
    font-weight: 900;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #757575;
    border-radius: 8px;
    font-size: 17px;
    font-family: inherit;
    background: #fff;
    color: #031326;
    transition: border-color 150ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

.form-group .form-input::placeholder {
    color: #757575;
    opacity: 1;
}

.form-input:focus {
    outline: none;
    border-color: #4dd1d1;
    box-shadow: 0 0 0 3px rgba(33, 128, 141, 0.4);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' 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 12px center;
    background-size: 16px;
    padding-right: 32px;
    cursor: pointer;
}

/* Character Counter */
.char-counter {
    font-size: 12px;
    font-weight: 700;
    color: #555c62;
    margin: 4px 0 0 0;
    text-align: right;
	transition: color 0.3s ease, font-size 0.3s ease;
}

.char-counter.under-limit, .char-counter.at-limit {
    color: #e61e3c;
	font-size: 14px;
	transition: color 0.3s ease, font-size 0.3s ease;
}

.char-counter span {
    font-weight: 700;
}

/* Advanced Toggle Button */
.advanced-section {
    margin-top: 20px;
    padding-top: 20px;
	gap: 5px;
}

.advanced-toggle {
    width: 100%;
    background: #f5f5f5;
    border: 2px solid #3b3d3f;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 15px;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.advanced-toggle:hover {
    background: #e4eaec;
    border-color: #031326;
}

.advanced-toggle.expanded {
    background: #d1ecf1;
    border-color: #17a2b8;
}

.toggle-icon {
    font-size: 35px;
    font-weight: bold;
    color: #031326;
    transition: transform 0.3s ease;
    width: 24px;
    text-align: center;
	margin-right: 15px;
}

.advanced-toggle.expanded .toggle-icon {
    color: #17a2b8;
}

.toggle-text {
    flex: 1;
}

.toggle-text strong {
    display: block;
    color: #031326;
    font-size: 22px;
}

.toggle-text small {
	margin: 10px 0 20px 35px;
    color: #40424a;
    font-size: 18px;
    font-weight: normal;
}

/* Hide advanced content by default */
.advanced-content {
    display: none;
    margin-top: 15px;
}

.advanced-content.show {
    display: block;
}

/* Advanced form styling */

.form-row {
    display: flex;
    gap: 40px;
}

.form-row .form-group {
    flex: 1;
}

/***********************
ERROR SUMMARY STYLES
***********************/
.error-summary {
    margin: 60px auto 0;
    max-width: 95%;
    background: linear-gradient(135deg, #fef6f6, #feebeb);
    border: 2px solid #f87171;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(248, 113, 113, 0.15);
    animation: shake 0.5s ease-in-out;
}

.error-summary-content h3 {
    color: #b91c1c;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-summary-content ul {
    margin: 0 0 15px 0;
    padding-left: 0;
    list-style: none;
}

.error-summary-content li {
    color: #b91c1c;
    font-size: 20px;
    font-weight: 500;
    margin: 8px 0;
    padding: 8px 12px;
    background: #fee1e1;
    border-radius: 10px;
    border-left: 4px solid #b91c1c;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-summary-content li::before {
    content: "→";
    color: #b91c1c;
    font-weight: 700;
    font-size: 30px;
}

.error-summary-hint {
    color: #6d1818;
    font-size: 18px;
    font-weight: 500;
    margin: 0;
    text-align: center;
	margin-top: 30px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/***********************
BUTTONS
***********************/

.generate-btn-wrap {
	max-width: 60%;
	width: 100%;
	margin: 0 auto 60px auto;
}

.finder-btn {
    appearance: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    transition: all .25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    text-align: center;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.finder-btn--primary {
    background: linear-gradient(135deg, #2B7CE9, #1E5DBF);
    color: #fff;
    box-shadow: 0 8px 25px rgba(43,124,233,.3);
}

.finder-btn--primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
    transition: left .6s;
}

.finder-btn--primary:hover::before {
    left: 100%;
}

.finder-btn--primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(43,124,233,.4);
}

.finder-btn--secondary {
    background: rgba(94, 82, 64, 0.12);
    color: #031326;
    border: 1px solid rgba(94, 82, 64, 0.2);
}

.finder-btn--secondary:hover {
    background: rgba(94, 82, 64, 0.2);
}

.finder-btn--lg {
    padding: 24px 30px;
    font-size: 36px;
    border-radius: 36px;
    letter-spacing: 0.3px;
    min-height: 56px;
}

.finder-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

.finder-btn:focus {
    outline: 2px solid #2B7CE9;
    outline-offset: 2px;
}

/***********************
LOADING SPINNER
***********************/
.loading-spinner {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.btn-text {
    transition: opacity 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

.finder-btn.loading .btn-text {
    opacity: 0.7;
}

/***********************
RESULTS SECTION
***********************/

.results-section h2 {
    font-size: 30px;
    font-weight: 700;
    margin: 0 auto 40px auto;
    color: #031326;
    line-height: 1.3;
    letter-spacing: 0.3px;
	text-align: center;
}

.results-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.result-item {
    background: #fff;
    border: 1px solid #949494;
    border-radius: 16px;
    padding: 16px;
    transition: all 150ms cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    position: relative;
}

.result-item:hover {
    border-color: #4dd1d1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
}

.result-item.copied {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.05);
}

.result-name {
    font-size: 22px;
    font-weight: 500;
    color: #031326;
    margin: 0;
}

.copy-hint {
    font-size: 12px;
	text-align: right;
    color: #3b3d3f;
    margin: 4px 0 0 0;
    opacity: 0;
    transition: opacity 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

.result-item:hover .copy-hint {
    opacity: 1;
}

.copied-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    color: #16a34a;
    font-size: 12px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

.result-item.copied .copied-indicator {
    opacity: 1;
}

.results-actions {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

/***********************
ERROR MESSAGES
***********************/
.error-message {
    margin-top: 32px;
    padding: 24px;
    background: rgba(192, 21, 47, 0.05);
    border: 1px solid rgba(192, 21, 47, 0.2);
    border-radius: 8px;
    text-align: center;
}

.error-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: #c0152f;
    margin: 0 0 8px 0;
}

.error-content p {
    color: #3b3d3f;
    margin: 0 0 16px 0;
}

/***********************
FOOTER
***********************/
.site-footer {
    background-color: white;
    border-top: 1px solid #e0e0e0;
    padding: 30px 20px;
    margin-top: 4rem;
}

.site-footer p {
    text-align: center;
    color: #444;
    font-size: 0.9rem;
	line-height: 1.6;
}

.site-footer a {
    color: #1e73be;
    text-decoration: none;
	transition: color 0.3s ease;
}

.site-footer a:hover {
	color: #09304f;
    text-decoration: underline;
}

/***********************
UTILITY CLASSES
***********************/
.hidden {
    display: none !important;
}

.loading {
    pointer-events: none;
}

/* Cloudflare Turnstile widget spacing inside form */
.cf-turnstile { 
  margin: 60px auto 24px auto;
  display: flex;
  justify-content: center;
  width: 100%;
}

/* Error styling for form inputs */
.form-input.error {
    border-color: #e61e3c;
    box-shadow: 0 0 0 3px rgba(230, 30, 60, 0.2);
}

/***********************
TABLET & MEDIUM SCREENS (≤ 768px)
***********************/
@media(max-width: 768px) {
    .podcast-name-generator-app {
        padding: 0 10px;
    }
    
    .app-header {
        padding: 20px;
        gap: 15px;
        justify-content: center;
        text-align: center;
        border-radius: 24px;
    }
    
    .app-header-text {
        text-align: center;
    }
    
    .app-header-text h1 {
        font-size: 30px;
        margin-bottom: 6px;
        text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }
    
    .app-header-text p {
        font-size: 20px;
        font-weight: 500;
        opacity: .95;
        line-height: 1.4;
    }
    
    .app-logo {
        width: 50px;
        height: 50px;
        border-radius: 4px;
    }
    
    .welcome-content {
        padding: 32px 20px 22px 20px;
    }
    
    .generator-form h2, .results-section h2 {
        font-size: 26px;
    }
    
    .form-description {
        font-size: 18px;
    }
    
    /* Single column layout for form rows */
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    /* Single column layout for results */
    .results-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .generate-btn-wrap {
        max-width: 80%;
    }
    
    .finder-btn {
        padding: 14px 24px;
        font-size: 15px;
    }
    
    .finder-btn--lg {
        padding: 18px 28px;
        font-size: 30px;
		border-radius: 30px;
        width: 100%;
    }
    
    .result-item {
        padding: 16px;
    }
    
    .result-name {
        font-size: 18px;
    }
    
    .error-summary {
        max-width: 100%;
        padding: 16px;
    }
    
    .error-summary-content h3 {
        font-size: 20px;
    }
    
    .error-summary-content li {
        font-size: 18px;
    }
	
	.toggle-text small {
		font-size: 17px;
	}
}

/***********************
MOBILE SCREENS (≤ 480px)
***********************/
@media(max-width: 480px) {
    .podcast-name-generator-app {
        padding: 0 8px;
    }
    
    .app-header {
        padding: 15px;
        margin: 20px 0;
    }
    
    .app-header-text h1 {
        font-size: 26px;
    }
    
    .app-header-text p {
        font-size: 18px;
    }
    
    .app-logo {
        width: 45px;
        height: 45px;
    }
    
    .welcome-content {
        padding: 24px 16px 18px 16px;
    }
    
    .generator-form h2, .results-section h2 {
        font-size: 22px;
    }
    
    .form-description {
        font-size: 17px;
    }
    
    .form-input {
        padding: 10px 12px;
        font-size: 15px;
    }
   
	.generate-btn-wrap {
        max-width: 100%;
    }
	
    .finder-btn--lg {
        padding: 16px 22px;
        font-size: clamp(24px, 7.5vw, 30px);
		border-radius: clamp(24px, 7.5vw, 30px);
    }
    
    .result-name {
        font-size: 18px;
    }
    
    .results-container {
        gap: 8px;
    }
    
    .result-item {
        padding: 12px;
    }

	.advanced-toggle {
		padding: 14px 10px;
		gap: 10px;
	}

	.toggle-icon {
		font-size: 28px;
		margin-right: 0;
	}
	
    .toggle-text strong {
        font-size: 20px;
    }
    
    .toggle-text small {
        font-size: 16px;
        margin: 8px 0 15px 0;
    }
}