/* =========================================================
   Chilukuri Krishnaprasad — Site Stylesheet
   Consolidated from: latest.css, latestheader.css,
   privacydialogue.css, success.css
   No HTML changes required — selectors match the existing
   markup exactly (.profile-image, .social-links, .container,
   .latestcontainer are both supported).
   ========================================================= */

/* ---------- Reset ---------- */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

/* ---------- Design tokens ---------- */
:root {
	--primary-color: #6e8efb;
	--primary-color-dark: #4b6cb7;
	--secondary-color: #2c3e50;
	--header-gradient-start: #BDB76B;
	--header-gradient-end: #a777e3;
	--light-color: #ecf0f1;
	--text-color: #333;
	--muted-text: #666;
	--success-bg: #d4edda;
	--success-text: #155724;
	--success-border: #c3e6cb;
	--error-bg: #f8d7da;
	--error-text: #721c24;
	--error-border: #f5c6cb;
	--shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1);
	--shadow-md: 0 5px 15px rgba(0, 0, 0, 0.08);
	--radius: 10px;
	--font-base: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ---------- Base ---------- */
body {
	font-family: var(--font-base);
	background-color: #f5f7fa;
	color: var(--text-color);
	line-height: 1.6;
}

h1 {
	font-size: 2.5rem;
	margin-bottom: 10px;
}

h2 {
	font-size: 1.8rem;
	color: var(--secondary-color);
	margin-bottom: 20px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--light-color);
}

/* Accessible focus states for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
	outline: 3px solid var(--primary-color);
	outline-offset: 2px;
}

/* ---------- Layout containers ---------- */
/* .container and .latestcontainer are aliased so either
   markup works without edits */
.container,
.latestcontainer {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
}

/* ---------- Header ---------- */
header {
	background: linear-gradient(135deg, var(--header-gradient-start), var(--header-gradient-end));
	color: white;
	padding: 50px 0;
	text-align: center;
}

.profile-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 20px;
}

.profile-image {
	width: 200px;
	height: 200px;
	border-radius: 50%;
	object-fit: cover;
	object-position: center top;
	border: 5px solid rgba(255, 255, 255, 0.5);
	box-shadow: var(--shadow-md);
}

.profile-info {
	margin-top: 0;
}

.profile-info .title {
	font-size: 1.2rem;
	opacity: 0.9;
	margin-bottom: 10px;
}

.profile-info .address {
	font-style: normal;
	opacity: 0.85;
	margin-bottom: 15px;
}

.social-links {
	display: flex;
	justify-content: center;
	gap: 15px;
}

.social-links a {
	display: inline-flex;
	transition: transform 0.2s ease;
	border-radius: 50%;
}

.social-links a:hover {
	transform: translateY(-3px);
}

.social-links img {
	border-radius: 50%;
}

@media (min-width: 768px) {
	.profile-container {
		flex-direction: row;
		text-align: left;
	}
	.social-links {
		justify-content: flex-start;
	}
}

/* ---------- Main content ---------- */
main {
	padding: 50px 0;
}

.section {
	background: white;
	border-radius: var(--radius);
	padding: 30px;
	margin-bottom: 30px;
	box-shadow: var(--shadow-sm);
}

.section-title {
	color: var(--secondary-color);
	margin-bottom: 20px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--light-color);
	font-size: 1.8rem;
}

/* ---------- Skills tree ---------- */
.tree-container {
	padding-left: 20px;
}

.tree {
	list-style-type: none;
	position: relative;
}

.tree li {
	margin: 10px 0;
	position: relative;
	padding-left: 30px;
}

.tree li:before {
	content: "";
	position: absolute;
	left: 0;
	top: 10px;
	width: 20px;
	height: 2px;
	background: var(--primary-color);
}

.tree li:after {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 2px;
	background: var(--primary-color);
}

.tree li:last-child:after {
	height: 10px;
}

.tree .category {
	font-weight: bold;
	color: var(--secondary-color);
	margin-bottom: 5px;
	display: block;
}

.tree .skills {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 5px;
}

.skill-tag {
	background: var(--light-color);
	padding: 5px 12px;
	border-radius: 20px;
	font-size: 0.9rem;
}

/* ---------- Contact form ---------- */
.contact-form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

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

.form-group.full-width {
	grid-column: 1 / -1;
}

label {
	display: block;
	margin-bottom: 5px;
	font-weight: 600;
}

input,
textarea {
	width: 100%;
	padding: 12px;
	border: 1px solid #ddd;
	border-radius: 5px;
	font-size: 1rem;
	font-family: inherit;
}

textarea {
	height: 150px;
	resize: vertical;
}

.privacy {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 20px;
}

.privacy input {
	width: auto;
	margin-top: 5px;
}

/* ---------- CAPTCHA ---------- */
.captcha-container {
	display: flex;
	align-items: center;
	gap: 15px;
	margin-bottom: 20px;
	padding: 15px;
	background: #f9f9f9;
	border-radius: 5px;
	border: 1px solid #ddd;
}

.captcha-question {
	font-weight: bold;
	font-size: 1.1rem;
	padding: 8px 15px;
	background: var(--light-color);
	border-radius: 5px;
	min-width: 120px;
	text-align: center;
}

.captcha-input {
	flex: 1;
	max-width: 150px;
}

.refresh-captcha {
	background: var(--primary-color);
	color: white;
	border: none;
	padding: 8px 12px;
	border-radius: 5px;
	cursor: pointer;
	transition: background 0.2s ease;
}

.refresh-captcha:hover {
	background: var(--primary-color-dark);
}

/* ---------- Buttons ---------- */
.btn {
	background: var(--primary-color);
	color: white;
	border: none;
	padding: 12px 30px;
	border-radius: 5px;
	cursor: pointer;
	font-size: 1rem;
	font-weight: 600;
	transition: background 0.2s ease;
}

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

.btn:disabled {
	background: #cccccc;
	cursor: not-allowed;
}

/* ---------- Success / error messages ---------- */
.message {
	padding: 15px;
	border-radius: 8px;
	margin-top: 20px;
	text-align: center;
}

.message[hidden] {
	display: none;
}

.message.success {
	background: var(--success-bg);
	color: var(--success-text);
	border: 1px solid var(--success-border);
}

.message.error {
	background: var(--error-bg);
	color: var(--error-text);
	border: 1px solid var(--error-border);
}

/* ---------- Privacy policy dialog ---------- */
.privacy-link {
	text-align: center;
	margin-top: 20px;
	color: var(--muted-text);
}

.privacy-link a {
	color: var(--primary-color-dark);
	text-decoration: none;
	cursor: pointer;
	font-weight: 500;
}

.privacy-link a:hover {
	text-decoration: underline;
}

.dialog-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	z-index: 1000;
	justify-content: center;
	align-items: center;
}

.dialog-overlay.open {
	display: flex;
}

.dialog-box {
	background: white;
	border-radius: var(--radius);
	width: 90%;
	max-width: 600px;
	max-height: 80vh;
	overflow-y: auto;
	box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.dialog-header {
	background: var(--primary-color-dark);
	color: white;
	padding: 20px;
	border-top-left-radius: var(--radius);
	border-top-right-radius: var(--radius);
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.dialog-header h2 {
	font-size: 22px;
	color: white;
	border: none;
	margin: 0;
	padding: 0;
}

.close-btn {
	background: none;
	border: none;
	color: white;
	font-size: 24px;
	cursor: pointer;
	padding: 0;
	width: 30px;
	height: 30px;
	display: flex;
	justify-content: center;
	align-items: center;
}

.dialog-content {
	padding: 25px;
	line-height: 1.6;
	color: #444;
}

.dialog-content h3 {
	margin: 20px 0 10px 0;
	color: var(--primary-color-dark);
}

.dialog-content p {
	margin-bottom: 15px;
}

.dialog-content ul {
	margin-bottom: 15px;
	padding-left: 20px;
}

/* ---------- Footer ---------- */
footer {
	background: var(--secondary-color);
	color: white;
	padding: 40px 0 20px;
}

.footer-content {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 30px;
	margin-bottom: 30px;
}

.footer-section h3 {
	margin-bottom: 20px;
	font-size: 1.3rem;
}

.footer-section a {
	color: white;
	text-decoration: none;
}

.footer-section a:hover {
	text-decoration: underline;
}

.address p {
	margin-bottom: 10px;
}

.copyright {
	text-align: center;
	padding-top: 20px;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	font-size: 0.9rem;
	opacity: 0.8;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
	.contact-form {
		grid-template-columns: 1fr;
	}
	.captcha-container {
		flex-direction: column;
		align-items: stretch;
	}
	.captcha-input {
		max-width: 100%;
	}
	.section-title {
		font-size: 1.5rem;
	}
	h1 {
		font-size: 2rem;
	}
}

@media (max-width: 480px) {
	.profile-image {
		width: 150px;
		height: 150px;
	}
	.social-links {
		flex-wrap: wrap;
	}
	.section {
		padding: 20px;
	}
}
