* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
}

:root {
    --primary: #3498db;
    --primary-dark: #2980b9;
    --secondary: #2c3e50;
    --accent: #e74c3c;
    --light: #ecf0f1;
    --dark: #1a252f;
    --success: #2ecc71;
    --warning: #f39c12;
    --display-bg: #1a252f;
    --button-bg: #2c3e50;
    --button-hover: #34495e;
    --button-active: #1a252f;
    --function-bg: #3498db;
    --function-hover: #2980b9;
    --operation-bg: #e74c3c;
    --operation-hover: #c0392b;
    --shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    --radius: 16px;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a252f, #2c3e50);
    color: var(--light);
    flex-direction: column;
}

/* Header */
.site-header {
    background-color: #1a252f;
    background: linear-gradient(135deg, #1a252f, #2c3e50);
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    position: relative;
    top: -20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
}

.logo img {
    height: 40px;
    margin-right: 10px;
    object-fit: cover;
    position: relative;
    top: 2px;
    filter: drop-shadow(0 0 3px rgb(255, 255, 255));
}

.logo a span {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: bolder;
    background: linear-gradient(to right, #aa00ff, #0015ff, #1b9400, #ffae00, #ff0000, #ffae00, #1b9400, #0015ff, #aa00ff);
    background-size: 200%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: animate-gradient 2.5s linear infinite;
    position: relative;
    top: -3px;
}

@keyframes animate-gradient {
    to {
        background-position: 200%;
    }
}

.logo a {
    text-decoration: none;
    color: white;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    margin-left: 20px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: #ffffff;
}

nav a::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #ffffff;
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

@media (min-width: 350px) and (max-width:390px) {
    .nav-links a {
        margin: 0 0 0 10px;
    }

    .site-header {
        padding: 5px 10px;
    }
}

@media (min-width: 300px) and (max-width:350px) {
    .nav-links a {
        font-size: small;
        margin: 0 0 0 10px;
    }

    .logo {
        gap: 0;
    }

    .logo a span {
        font-size: 1.2rem;
        position: relative;
        top: -5px;
    }

    .site-header {
        padding: 5px 10px;
    }
}



.calculator-container {
    width: 100%;
    max-width: 420px;
    background: var(--secondary);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.calculator-container:hover {
    transform: translateY(-5px);
}

.header {
    background: var(--secondary);
    color: white;
    padding: 20px;
    text-align: center;
    border-bottom: 2px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content {
    text-align: left;
}

.header h1 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header h1 i {
    color: var(--accent);
}

.header p {
    font-size: 0.9rem;
    opacity: 0.8;
}

.export-buttons {
    display: flex;
    gap: 10px;
}

.export-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: white;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.export-btn:hover {
    background: var(--primary);
    transform: scale(1.05);
}

.display {
    background: var(--display-bg);
    padding: 20px;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    position: relative;
}

.history {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    min-height: 28px;
    margin-bottom: 10px;
    width: 100%;
    text-align: right;
    word-break: break-all;
    max-height: 80px;
    overflow-y: auto;
    padding-right: 5px;
}

.history::-webkit-scrollbar {
    width: 5px;
}

.history::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.current-input {
    color: white;
    font-size: 2.8rem;
    font-weight: 300;
    width: 100%;
    text-align: right;
    word-break: break-all;
    min-height: 50px;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 20px;
    background: var(--secondary);
}

.button {
    background: var(--button-bg);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 5px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    user-select: none;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
}

.button:active {
    transform: translateY(1px);
}

.number {
    background: var(--button-bg);
}

.number:hover {
    background: var(--button-hover);
}

.function {
    background: var(--function-bg);
    font-size: 1.1rem;
}

.function:hover {
    background: var(--function-hover);
}

.operation {
    background: var(--operation-bg);
}

.operation:hover {
    background: var(--operation-hover);
}

.equals {
    background: var(--success);
    grid-column: span 2;
}

.equals:hover {
    background: #27ae60;
}

.clear {
    background: var(--warning);
    color: var(--dark);
}

.clear:hover {
    background: #e67e22;
}

.footer {
    background: var(--secondary);
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    padding: 15px;
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 480px) {
    .calculator-container {
        max-width: 100%;
        border-radius: 12px;
    }

    .button {
        padding: 14px 5px;
        font-size: 1.1rem;
    }

    .current-input {
        font-size: 2.2rem;
    }

    .header {
        flex-direction: column;
        gap: 15px;
    }

    .header-content {
        text-align: center;
    }
}

.seo-section {
  max-width: 960px;
  margin: 40px auto;
  padding: 30px 20px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  line-height: 1.8;
  font-size: 1rem;
  color: #212529;
}

.seo-section h2 {
  font-size: 1.8rem;
  color: #4361ee;
  margin-bottom: 20px;
  border-bottom: 2px solid #4361ee;
  padding-bottom: 10px;
}

.seo-section h3 {
  font-size: 1.4rem;
  margin-top: 30px;
  margin-bottom: 15px;
  color: #3f37c9;
}

.seo-section p {
  margin-bottom: 15px;
}

.seo-section ul {
  list-style: disc;
  padding-left: 20px;
  margin-bottom: 20px;
}

.seo-section ul li {
  margin-bottom: 10px;
}

.seo-section ol {
  list-style: decimal;
  padding-left: 20px;
  margin-bottom: 20px;
}

.seo-section ol li {
  margin-bottom: 10px;
}

.seo-section strong {
  color: #4361ee;
}

.seo-section a {
  color: #3f37c9;
  text-decoration: underline;
}

.seo-section a:hover {
  text-decoration: none;
}

footer {
    width: 100%;
}

footer p a {
    text-decoration: none;
    font-weight: bold;
    color: #aa00ff;
}