/* style.css */

/* 1. CSS Reset & Variables */
/* applys to all elements */
/* Removes default spacing browsers add */
/* box-sizing:border-box; → Makes width & height include padding and border */

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

:root {
    --primary: #ff6b6b;
    --secondary: #4ecdc4;
    --accent: #ffbe0b;
    --light: #f7f9f7;
    --dark: #2d3436;
    --success: #1dd1a1;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1); /* Shadow preset - Used for card or box shadows */
    --transition: all 0.3s ease;  /* Transition preset - Smooth animation timing */
}

/* 2. Global Body */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh; /* full screen height */
    padding: 20px;
    position: relative;
    /* overflow: hidden; /* Prevents overflow issues */ 
}

/* 3. Layout Containers */
.container {
    max-width: 1200px;
    margin: auto;
}

/* 4. Header Styles */
/* Flexbox for logo alignment */
/* Gradient text using -webkit-background-clip */
header {
    text-align: center;
    padding: 30px 0;
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.logo-icon {
    font-size: 2.5rem;
    color: var(--primary);
}

.logo-text {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;

}

.tagline {
    font-size: 1.1rem;
    color: #636e72;
    margin-top: 10px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* 5. grid layout for cards */
/* Responsive grid for cards */
/* main layout for cards */
/* mobile single column, tablet, desktop two columns */
.app-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 768px) {
    .app-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* 6. Form Styles */
.form-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.form-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light);
    color: var(--dark);
    position: relative;
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 80px;
    height: 2px;
    background: var(--primary);
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #636e72;
}

input, textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: var(--transition);
}

input:focus, textarea:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.2);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.file-upload {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.file-upload-btn {
    width: 100%;
    padding: 14px;
    background: var(--light);
    border: 2px dashed #b2bec3;
    border-radius: 12px;
    text-align: center;
    color: #636e72;
    cursor: pointer;
    transition: var(--transition);
}

.file-upload-btn:hover {
    background: #e0f7fa;
    border-color: var(--secondary);
}

.file-upload input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
    height: 100%;
    width: 100%;
}

.preview-image {
    margin-top: 15px;
    max-width: 100%;
    border-radius: 10px;
    border: 1px solid #eee;
    display: none;
}

/* 7. Button Styles */
.btn {
    display: inline-block;
    padding: 14px 30px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    width: 100%;
    margin-top: 10px;

}

.btn:hover {
    background: #ff5252;
    box-shadow: 0 7px 15px rgba(255, 107, 107, 0.3);
    transform: translateY(-3px);
}

.btn:active {
    transform: translateY(-1px);
}

.btn-generate {
    background: var(--secondary);
}

.btn-generate:hover {
    background: #3dc0b8;
    box-shadow: 0 7px 15px rgba(78, 205, 196, 0.2);
}


/* 8. Card Preview Styles */
.preview-section {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.card-container {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    /*box-shadow: var(--shadow);*/
    transition: var(--transition);
    position: relative;

}

.card-container:hover {
    transform: translateY(-5px);
    /*box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);*/

}

.card-header {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    padding: 30px 20px;
    text-align: center;
}

.card-title {
    font-size: 2.2rem;
    color: white;
    font-weight: 700;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
}

.card-body {
    padding: 30px;

}

/* image properly displaying- fixed */
.card-image {
    width: 100%;
    height: 100%;
    background: #f1f2f6;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 25px;

}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;

}

.card-image-placeholder {
    color: #b2bec3;
    font-size: 4rem;

}

.card-message {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--dark);
    font-style: italic;
    text-align: center;
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid var(--accent);
}

.card-footer {
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    font-weight: 600;
    color: #636e72;
    font-size: 0.9rem;

}

/* 9. Action Buttons */
/* Responsive buttons for download & share. */
.action-btns {
    display: block;
    /*
    grid-template-columns: 1fr;
    gap: 15px; */

    width: 100%;
}

@media (min-width: 480px) {
    .action-btns {
        grid-template-columns: 1fr 1fr;

    }
}

.btn-download {
    background: var(--accent);

}

.btn-download:hover {
    background: #f9b208;
    box-shadow: 0 7px 15px rgba(255, 190, 11, 0.3);

}


/* 10. Animations */
/* Smooth element appearance. */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* 11. Footer */
footer {
    text-align: center;
    margin-top: 50px;
    padding: 30px 0;
    color: #636e72;
    font-size: 0.9rem;
    border-top: 2px solid var(--light);
    width: 100%;
}

footer p {
    text-decoration: none;
}

footer a {
    color: var(--dark);
    text-decoration: none;
    transition: var(--transition);
}

footer a:hover {
    color: inherit;
    
}

/* 12. Responsive Styles */
@media (max-width: 767px) {
    .logo-text {
        font-size: 1.8rem
    }

    .card-title {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .section-title::after {
        background: var(--primary);
    }

}


