/* ============================================
   Lab 3 - External CSS Stylesheet
   CSE 3208 Web Engineering Lab | KYAU
   ============================================ */

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

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
}

/* --- Header with Gradient Background --- */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 40px 20px;
}

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

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* --- Navigation Bar --- */
nav {
    background: #2c3e50;
    padding: 12px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav a {
    color: white;
    text-decoration: none;
    margin: 0 12px;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background 0.3s ease;
    display: inline-block;
}

nav a:hover {
    background: #1abc9c;
    transform: translateY(-2px);
}

/* --- Main Content --- */
main {
    max-width: 900px;
    margin: 30px auto;
    padding: 0 20px;
}

/* --- Card Sections --- */
.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.card h2 {
    color: #2c3e50;
    font-size: 1.6em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
}

/* --- Demo Boxes --- */
.demo-box {
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
    color: white;
}

.gradient-box {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.solid-box {
    background: #1abc9c;
}

/* --- Text Styling --- */
.styled-text-1 {
    font-family: Arial, sans-serif;
    font-size: 18px;
    margin: 10px 0;
    padding: 10px;
    background: #ffeaa7;
    border-radius: 5px;
}

.styled-text-2 {
    font-family: Georgia, serif;
    font-size: 20px;
    margin: 10px 0;
    padding: 10px;
    background: #dfe6e9;
    border-radius: 5px;
}

.styled-text-3 {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-style: italic;
    margin: 10px 0;
    padding: 10px;
    background: #d5f5e3;
    border-radius: 5px;
}

/* --- Box Model Demo --- */
.box-model-demo {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.outer-box {
    background: #fab1a0;
    padding: 5px;
    text-align: center;
    border-radius: 8px;
    margin: 20px;
}

.middle-box {
    background: #ffeaa7;
    border: 3px solid #e17055;
    padding: 5px;
    border-radius: 6px;
}

.inner-box {
    background: #81ecec;
    padding: 20px;
    border-radius: 4px;
}

/* --- Hover Effect Links --- */
.link-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 20px;
}

.hover-link {
    display: inline-block;
    padding: 15px 25px;
    text-decoration: none;
    color: white;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.link-1 {
    background: #e74c3c;
}
.link-1:hover {
    transform: scale(1.15);
}

.link-2 {
    background: #3498db;
}
.link-2:hover {
    background: #e74c3c;
    color: #fff;
}

.link-3 {
    background: #2ecc71;
}
.link-3:hover {
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.5);
    transform: translateY(-3px);
}

.link-4 {
    background: #9b59b6;
}
.link-4:hover {
    transform: rotate(5deg) scale(1.05);
}

/* --- Footer --- */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 30px;
}

/* --- Responsive Media Query (Mobile View) --- */
@media screen and (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    nav a {
        display: block;
        margin: 5px auto;
        width: 80%;
    }

    main {
        padding: 0 10px;
    }

    .card {
        padding: 15px;
    }

    .link-container {
        flex-direction: column;
        align-items: center;
    }

    .hover-link {
        width: 80%;
        text-align: center;
    }
}
